]>
src.bluestatic.org Git - isso.git/blob - UnitTest/LoaderTest.php
4 require_once('./../Loader.php');
10 * @copyright Copyright ©2002 - [#]year[#], Blue Static
15 class LoaderTest
extends UnitTestCase
19 public function testNewRegister()
21 $this->instance
= BSLoader
::NewRegister();
23 $this->assertEqual(get_class($this->instance
), 'BSRegister');
26 public function testGetAllRegisters()
28 $this->assertIsA(BSLoader
::GetAllRegisters(), 'array', 'Register array is not an array');
29 $this->assertEqual(sizeof(BSLoader
::GetAllRegisters()), 1, 'Register array is wrong size');
32 public function testSetGetRegister()
34 BSLoader
::SetRegister($this->instance
);
36 $this->assertReference(BSLoader
::GetRegister(), $this->instance
);
39 public function testRegisterAfterMakeNew()
41 BSLoader
::NewRegister();
43 $this->assertEqual(get_class(BSLoader
::GetRegister(1)), 'BSRegister', 'Failed to get arbitrary register');
44 $this->assertEqual(sizeof(BSLoader
::GetAllRegisters()), 2, 'Sizeof register array is wrong');
45 $this->assertReference($this->instance
, BSLoader
::GetRegister(), 'Main register does not match instance');
48 public function testLoadModule()
50 $this->assertEqual(get_class(BSLoader
::LoadModule('Input')), 'BSInput');
53 public function testLoadBadModule()
55 BSLoader
::LoadModule('nonExistentModule');