1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-18 03:20:59 +01:00
phorge-phorge/src/__tests__/PhabricatorCelerityTestCase.php
Joshua Spence 36e2d02d6e phtize all the things
Summary: `pht`ize a whole bunch of strings in rP.

Test Plan: Intense eyeballing.

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: hach-que, Korvin, epriestley

Differential Revision: https://secure.phabricator.com/D12797
2015-05-22 21:16:39 +10:00

36 lines
1.1 KiB
PHP

<?php
final class PhabricatorCelerityTestCase extends PhabricatorTestCase {
/**
* This is more of an acceptance test case instead of a unit test. It verifies
* that the Celerity map is up-to-date.
*/
public function testCelerityMaps() {
$resources_map = CelerityPhysicalResources::getAll();
foreach ($resources_map as $resources) {
$old_map = new CelerityResourceMap($resources);
$new_map = id(new CelerityResourceMapGenerator($resources))
->generate();
// Don't actually compare these values with assertEqual(), since the diff
// isn't helpful and is often enormously huge.
$maps_are_identical =
($new_map->getNameMap() === $old_map->getNameMap()) &&
($new_map->getSymbolMap() === $old_map->getSymbolMap()) &&
($new_map->getRequiresMap() === $old_map->getRequiresMap()) &&
($new_map->getPackageMap() === $old_map->getPackageMap());
$this->assertTrue(
$maps_are_identical,
pht(
'When this test fails, it means the Celerity resource map is out '.
'of date. Run `%s` to rebuild it.',
'bin/celerity map'));
}
}
}