UpdateServiceTest.php 881 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <?php
  2. namespace Elgg;
  3. class UpgradeServiceTest extends \PHPUnit_Framework_TestCase {
  4. /**
  5. * @var \Elgg\UpgradeService
  6. */
  7. private $service;
  8. protected function setUp() {
  9. $this->service = new \Elgg\UpgradeService();
  10. }
  11. protected function tearDown() {
  12. // @todo should be re-enabled if test is complete
  13. //$this->service->releaseUpgradeMutex();
  14. }
  15. /**
  16. * This will test an upgrade run, just like calling /upgrade.php
  17. */
  18. public function testUpgradeRun() {
  19. // marked as incomplete because $CONFIG isn't available
  20. $this->markTestIncomplete();
  21. try {
  22. // running database upgrades can through exceptions
  23. $result = $this->service->run();
  24. $this->assertTrue(is_array($result));
  25. $this->assertArrayHasKey("failure", $result);
  26. $this->assertFalse($result["failure"]);
  27. } catch (Exception $e) {
  28. $this->fail($e->getMessage());
  29. }
  30. }
  31. }