Path: blob/master/src/__tests__/PhabricatorCelerityTestCase.php
12240 views
<?php12final class PhabricatorCelerityTestCase extends PhabricatorTestCase {34/**5* This is more of an acceptance test case instead of a unit test. It verifies6* that the Celerity map is up-to-date.7*/8public function testCelerityMaps() {9$resources_map = CelerityPhysicalResources::getAll();1011foreach ($resources_map as $resources) {12$old_map = new CelerityResourceMap($resources);1314$new_map = id(new CelerityResourceMapGenerator($resources))15->generate();1617// Don't actually compare these values with assertEqual(), since the diff18// isn't helpful and is often enormously huge.1920$maps_are_identical =21($new_map->getNameMap() === $old_map->getNameMap()) &&22($new_map->getSymbolMap() === $old_map->getSymbolMap()) &&23($new_map->getRequiresMap() === $old_map->getRequiresMap()) &&24($new_map->getPackageMap() === $old_map->getPackageMap());2526$this->assertTrue(27$maps_are_identical,28pht(29'When this test fails, it means the Celerity resource map is out '.30'of date. Run `%s` to rebuild it.',31'bin/celerity map'));32}33}3435}363738