00001 <?php 00002 require_once 'PHPUnit/Framework.php'; 00003 00004 require_once dirname( __FILE__ ).'/../../../_start.php'; 00005 00010 class CorujaClassManipulationTest extends PHPUnit_Framework_TestCase 00011 { 00018 protected function setUp() 00019 { 00020 } 00021 00028 protected function tearDown() 00029 { 00030 } 00031 00035 public function testGetClassNameFromClassDefinitionWithNullString() { 00036 00037 // set up 00038 $strClassDefinition = null; 00039 00040 // exercise 00041 $strClassName = CorujaClassManipulation::getClassNameFromClassDefinition( $strClassDefinition ); 00042 00043 // assert 00044 $this->assertNull( $strClassName ); 00045 00046 00047 // Remove the following lines when you implement this test. 00048 $this->markTestIncomplete( 00049 'This test has not been implemented yet.' 00050 ); 00051 } 00052 00056 public function testGetClassNameFromClassDefinitionWithAnyString() { 00057 00058 // set up 00059 $strClassDefinition = "anystring"; 00060 00061 // exercise 00062 $strClassName = CorujaClassManipulation::getClassNameFromClassDefinition( $strClassDefinition ); 00063 00064 // assert 00065 $this->assertNull( $strClassName ); 00066 00067 00068 // Remove the following lines when you implement this test. 00069 $this->markTestIncomplete( 00070 'This test has not been implemented yet.' 00071 ); 00072 } 00073 00077 public function testGetClassNameFromClassDefinitionWithNormalClassDefinition() { 00078 00079 // set up 00080 $strClassDefinition = "anynamespace::anyclassname"; 00081 00082 // exercise 00083 $strClassName = CorujaClassManipulation::getClassNameFromClassDefinition( $strClassDefinition ); 00084 00085 // assert 00086 $this->assertEquals( "anyclassname", $strClassName ); 00087 00088 } 00089 00093 public function testGetNamespaceFromClassDefinitionWithNullString() { 00094 00095 // set up 00096 $strClassDefinition = null; 00097 00098 // exercise 00099 $strNamespace = CorujaClassManipulation::getNamespaceFromClassDefinition( $strClassDefinition ); 00100 00101 // assert 00102 $this->assertNull( $strNamespace ); 00103 00104 // Remove the following lines when you implement this test. 00105 $this->markTestIncomplete( 00106 'This test has not been implemented yet.' 00107 ); 00108 } 00109 00113 public function testGetNamespaceFromClassDefinitionWithAnyString() { 00114 00115 // set up 00116 $strClassDefinition = "anystring"; 00117 00118 // exercise 00119 $strNamespace = CorujaClassManipulation::getNamespaceFromClassDefinition( $strClassDefinition ); 00120 00121 // assert 00122 $this->assertNull( $strNamespace ); 00123 00124 // Remove the following lines when you implement this test. 00125 $this->markTestIncomplete( 00126 'This test has not been implemented yet.' 00127 ); 00128 } 00129 00133 public function testGetNamespaceFromClassDefinitionWithNormalClassDefinition() { 00134 00135 // set up 00136 $strClassDefinition = "anynamespace::anyclassname"; 00137 00138 // exercise 00139 $strNamespace = CorujaClassManipulation::getNamespaceFromClassDefinition( $strClassDefinition ); 00140 00141 // assert 00142 $this->assertEquals( "anynamespace", $strNamespace ); 00143 } 00144 } 00145 ?>
1.5.9