Provide a "--local" flag to "bin/conduit call" to force in-process execution
[phabricator/blender.git] / src / __tests__ / PhabricatorInfrastructureTestCase.php
blob19d034eb34cab01c949a1b4c31f2af3e1bf176a8
1 <?php
3 final class PhabricatorInfrastructureTestCase extends PhabricatorTestCase {
5 protected function getPhabricatorTestCaseConfiguration() {
6 return array(
7 self::PHABRICATOR_TESTCONFIG_BUILD_STORAGE_FIXTURES => true,
8 );
11 public function testApplicationsInstalled() {
12 $all = PhabricatorApplication::getAllApplications();
13 $installed = PhabricatorApplication::getAllInstalledApplications();
15 $this->assertEqual(
16 count($all),
17 count($installed),
18 pht('In test cases, all applications should default to installed.'));
21 public function testRejectMySQLNonUTF8Queries() {
22 $table = new HarbormasterScratchTable();
23 $conn_r = $table->establishConnection('w');
25 $snowman = "\xE2\x98\x83";
26 $invalid = "\xE6\x9D";
28 qsprintf($conn_r, 'SELECT %B', $snowman);
29 qsprintf($conn_r, 'SELECT %s', $snowman);
30 qsprintf($conn_r, 'SELECT %B', $invalid);
32 $caught = null;
33 try {
34 qsprintf($conn_r, 'SELECT %s', $invalid);
35 } catch (AphrontCharacterSetQueryException $ex) {
36 $caught = $ex;
39 $this->assertTrue($caught instanceof AphrontCharacterSetQueryException);