ElggTravisInstallTest.php 813 B

12345678910111213141516171819202122232425262728293031323334353637
  1. <?php
  2. class ElggTravisInstallTest extends \ElggCoreUnitTest {
  3. public function setUp() {
  4. if (!getenv('TRAVIS')) {
  5. $this->skipIf(true, "Not Travis VM");
  6. }
  7. }
  8. public function testDbWasInstalled() {
  9. _elgg_services()->db->assertInstalled();
  10. }
  11. public function testThemePluginsAreLast() {
  12. $plugins = elgg_get_plugins('all');
  13. $plugins = array_reverse($plugins);
  14. /* @var \ElggPlugin[] $plugins */
  15. $found_non_theme = false;
  16. foreach ($plugins as $i => $plugin) {
  17. $is_theme = in_array('theme', $plugin->getManifest()->getCategories());
  18. if ($found_non_theme) {
  19. $this->assertFalse($is_theme, 'All themes come last');
  20. } else {
  21. if ($i === 0) {
  22. $this->assertTrue($is_theme, 'Last plugin is a theme');
  23. }
  24. if (!$is_theme) {
  25. $found_non_theme = true;
  26. }
  27. }
  28. }
  29. }
  30. }