Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/phabricator
Path: blob/master/src/__tests__/PhabricatorCelerityTestCase.php
12240 views
1
<?php
2
3
final class PhabricatorCelerityTestCase extends PhabricatorTestCase {
4
5
/**
6
* This is more of an acceptance test case instead of a unit test. It verifies
7
* that the Celerity map is up-to-date.
8
*/
9
public function testCelerityMaps() {
10
$resources_map = CelerityPhysicalResources::getAll();
11
12
foreach ($resources_map as $resources) {
13
$old_map = new CelerityResourceMap($resources);
14
15
$new_map = id(new CelerityResourceMapGenerator($resources))
16
->generate();
17
18
// Don't actually compare these values with assertEqual(), since the diff
19
// isn't helpful and is often enormously huge.
20
21
$maps_are_identical =
22
($new_map->getNameMap() === $old_map->getNameMap()) &&
23
($new_map->getSymbolMap() === $old_map->getSymbolMap()) &&
24
($new_map->getRequiresMap() === $old_map->getRequiresMap()) &&
25
($new_map->getPackageMap() === $old_map->getPackageMap());
26
27
$this->assertTrue(
28
$maps_are_identical,
29
pht(
30
'When this test fails, it means the Celerity resource map is out '.
31
'of date. Run `%s` to rebuild it.',
32
'bin/celerity map'));
33
}
34
}
35
36
}
37
38