Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/phabricator
Path: blob/master/src/__tests__/PhabricatorInfrastructureTestCase.php
12240 views
1
<?php
2
3
final class PhabricatorInfrastructureTestCase extends PhabricatorTestCase {
4
5
protected function getPhabricatorTestCaseConfiguration() {
6
return array(
7
self::PHABRICATOR_TESTCONFIG_BUILD_STORAGE_FIXTURES => true,
8
);
9
}
10
11
public function testApplicationsInstalled() {
12
$all = PhabricatorApplication::getAllApplications();
13
$installed = PhabricatorApplication::getAllInstalledApplications();
14
15
$this->assertEqual(
16
count($all),
17
count($installed),
18
pht('In test cases, all applications should default to installed.'));
19
}
20
21
public function testRejectMySQLNonUTF8Queries() {
22
$table = new HarbormasterScratchTable();
23
$conn_r = $table->establishConnection('w');
24
25
$snowman = "\xE2\x98\x83";
26
$invalid = "\xE6\x9D";
27
28
qsprintf($conn_r, 'SELECT %B', $snowman);
29
qsprintf($conn_r, 'SELECT %s', $snowman);
30
qsprintf($conn_r, 'SELECT %B', $invalid);
31
32
$caught = null;
33
try {
34
qsprintf($conn_r, 'SELECT %s', $invalid);
35
} catch (AphrontCharacterSetQueryException $ex) {
36
$caught = $ex;
37
}
38
39
$this->assertTrue($caught instanceof AphrontCharacterSetQueryException);
40
}
41
42
}
43
44