Path: blob/master/src/__tests__/PhabricatorInfrastructureTestCase.php
12240 views
<?php12final class PhabricatorInfrastructureTestCase extends PhabricatorTestCase {34protected function getPhabricatorTestCaseConfiguration() {5return array(6self::PHABRICATOR_TESTCONFIG_BUILD_STORAGE_FIXTURES => true,7);8}910public function testApplicationsInstalled() {11$all = PhabricatorApplication::getAllApplications();12$installed = PhabricatorApplication::getAllInstalledApplications();1314$this->assertEqual(15count($all),16count($installed),17pht('In test cases, all applications should default to installed.'));18}1920public function testRejectMySQLNonUTF8Queries() {21$table = new HarbormasterScratchTable();22$conn_r = $table->establishConnection('w');2324$snowman = "\xE2\x98\x83";25$invalid = "\xE6\x9D";2627qsprintf($conn_r, 'SELECT %B', $snowman);28qsprintf($conn_r, 'SELECT %s', $snowman);29qsprintf($conn_r, 'SELECT %B', $invalid);3031$caught = null;32try {33qsprintf($conn_r, 'SELECT %s', $invalid);34} catch (AphrontCharacterSetQueryException $ex) {35$caught = $ex;36}3738$this->assertTrue($caught instanceof AphrontCharacterSetQueryException);39}4041}424344