3 require_once 'PHPUnit/Framework.php';
4 require_once 'ISSO/Installer.php';
6 class InstallerTest
extends PHPUnit_Framework_TestCase
11 public function setUp()
16 BSApp
::Registry()->input
= $this->input
= BSApp
::LoadModule('Input');
19 private function _loadClass()
22 $this->fixture
= new TestInstallerFixture('InstallerTest.php');
23 $data = ob_get_contents();
29 public function stepCheck($step)
31 $this->assertEquals($this->input
->in
['step'], $step);
34 public function testWelcome()
36 $this->input
->in
['step'] = 0;
37 $data = $this->_loadClass();
38 $this->assertTrue(strpos($data, 'This is a welcome page.') !== false);
41 public function testStep1()
43 $this->input
->in
['step'] = 1;
44 $data = $this->_loadClass();
45 $this->assertTrue(strpos($data, '<div class="buttonlink"><a href="InstallerTest.php?step=2">Next Step</a></div>') !== false);
48 public function testLastStep()
50 $this->input
->in
['step'] = 2;
51 $data = $this->_loadClass();
52 $this->assertTrue(strpos($data, '<div class="buttonlink">FINAL LINK</div>') !== false);
56 class TestInstallerFixture
extends BSInstaller
60 protected function _pageTitle()
62 return 'Test Installer';
65 protected function _finalLink()
70 protected function _welcomePage()
72 return 'This is a welcome page.';
75 public function step1()
81 public function step2()