3 require_once 'PHPUnit/Framework.php';
4 require_once ISSO
. '/Installer.php';
5 require_once ISSO
. '/Input.php';
7 class InstallerTest
extends PHPUnit_Framework_TestCase
12 public function setUp()
17 BSApp
::$input = new BSInput();
20 private function _loadClass()
23 $this->fixture
= new TestInstallerFixture('InstallerTest.php');
24 $data = ob_get_contents();
30 public function stepCheck($step)
32 $this->assertEquals($this->input
->in
['step'], $step);
35 public function testWelcome()
37 $this->input
->in
['step'] = 0;
38 $data = $this->_loadClass();
39 $this->assertTrue(strpos($data, 'This is a welcome page.') !== false
);
42 public function testStep1()
44 $this->input
->in
['step'] = 1;
45 $data = $this->_loadClass();
46 $this->assertTrue(strpos($data, '<div class="buttonlink"><a href="InstallerTest.php?step=2">Next Step</a></div>') !== false
);
49 public function testLastStep()
51 $this->input
->in
['step'] = 2;
52 $data = $this->_loadClass();
53 $this->assertTrue(strpos($data, '<div class="buttonlink">FINAL LINK</div>') !== false
);
57 class TestInstallerFixture
extends BSInstaller
61 protected function _pageTitle()
63 return 'Test Installer';
66 protected function _finalLink()
71 protected function _welcomePage()
73 echo 'This is a welcome page.';
76 public function step1()
82 public function step2()