| 1 |  |  | <?php | 
            
                                                                                                            
                            
            
                                    
            
            
                | 2 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 3 |  |  | namespace SimpleORM; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 4 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 5 |  |  | /** | 
            
                                                                                                            
                            
            
                                    
            
            
                | 6 |  |  |  * Generated by PHPUnit_SkeletonGenerator on 2015-12-05 at 16:25:11. | 
            
                                                                                                            
                            
            
                                    
            
            
                | 7 |  |  |  */ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 8 |  |  | class AbstractDataMapperTest extends \PHPUnit_Framework_TestCase | 
            
                                                                                                            
                            
            
                                    
            
            
                | 9 |  |  | { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 10 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 11 |  |  | 	/** | 
            
                                                                                                            
                            
            
                                    
            
            
                | 12 |  |  | 	 * @var AbstractDataMapper | 
            
                                                                                                            
                            
            
                                    
            
            
                | 13 |  |  | 	 */ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 14 |  |  | 	protected $object; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 15 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 16 |  |  | 	/** | 
            
                                                                                                            
                            
            
                                    
            
            
                | 17 |  |  | 	 * Sets up the fixture, for example, opens a network connection. | 
            
                                                                                                            
                            
            
                                    
            
            
                | 18 |  |  | 	 * This method is called before a test is executed. | 
            
                                                                                                            
                            
            
                                    
            
            
                | 19 |  |  | 	 */ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 20 |  |  | 	protected function setUp() | 
            
                                                                                                            
                            
            
                                    
            
            
                | 21 |  |  | 	{ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 22 |  |  | 		//$this->object = new AbstractDataMapper; | 
                            
                    |  |  |  | 
                                                                                        
                                                                                     | 
            
                                                                                                            
                            
            
                                    
            
            
                | 23 |  |  | 	} | 
            
                                                                                                            
                            
            
                                    
            
            
                | 24 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 25 |  |  | 	/** | 
            
                                                                                                            
                            
            
                                    
            
            
                | 26 |  |  | 	 * Tears down the fixture, for example, closes a network connection. | 
            
                                                                                                            
                            
            
                                    
            
            
                | 27 |  |  | 	 * This method is called after a test is executed. | 
            
                                                                                                            
                            
            
                                    
            
            
                | 28 |  |  | 	 */ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 29 |  |  | 	protected function tearDown() | 
            
                                                                                                            
                            
            
                                    
            
            
                | 30 |  |  | 	{ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 31 |  |  | 		 | 
            
                                                                                                            
                            
            
                                    
            
            
                | 32 |  |  | 	} | 
            
                                                                                                            
                            
            
                                    
            
            
                | 33 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 34 |  |  | 	/** | 
            
                                                                                                            
                            
            
                                    
            
            
                | 35 |  |  | 	 * @covers SimpleORM\AbstractDataMapper::getEntityTable | 
            
                                                                                                            
                            
            
                                    
            
            
                | 36 |  |  | 	 * @todo   Implement testGetEntityTable(). | 
            
                                                                                                            
                                                                
            
                                    
            
            
                | 37 |  |  | 	 */ | 
            
                                                                        
                            
            
                                    
            
            
                | 38 |  |  | 	public function testGetEntityTable() | 
            
                                                                        
                            
            
                                    
            
            
                | 39 |  |  | 	{ | 
            
                                                                        
                            
            
                                    
            
            
                | 40 |  |  | 		// Remove the following lines when you implement this test. | 
            
                                                                        
                            
            
                                    
            
            
                | 41 |  |  | 		$this->markTestIncomplete( | 
            
                                                                        
                            
            
                                    
            
            
                | 42 |  |  | 				'This test has not been implemented yet.' | 
            
                                                                        
                            
            
                                    
            
            
                | 43 |  |  | 		); | 
            
                                                                        
                            
            
                                    
            
            
                | 44 |  |  | 	} | 
            
                                                                                                            
                            
            
                                    
            
            
                | 45 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 46 |  |  | 	/** | 
            
                                                                                                            
                            
            
                                    
            
            
                | 47 |  |  | 	 * @covers SimpleORM\AbstractDataMapper::getAdapter | 
            
                                                                                                            
                            
            
                                    
            
            
                | 48 |  |  | 	 * @todo   Implement testGetAdapter(). | 
            
                                                                                                            
                            
            
                                    
            
            
                | 49 |  |  | 	 */ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 50 |  |  | 	public function testGetAdapter() | 
            
                                                                                                            
                            
            
                                    
            
            
                | 51 |  |  | 	{ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 52 |  |  | 		// Remove the following lines when you implement this test. | 
            
                                                                                                            
                            
            
                                    
            
            
                | 53 |  |  | 		$this->markTestIncomplete( | 
            
                                                                                                            
                            
            
                                    
            
            
                | 54 |  |  | 				'This test has not been implemented yet.' | 
            
                                                                                                            
                            
            
                                    
            
            
                | 55 |  |  | 		); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 56 |  |  | 	} | 
            
                                                                                                            
                            
            
                                    
            
            
                | 57 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 58 |  |  | 	/** | 
            
                                                                                                            
                            
            
                                    
            
            
                | 59 |  |  | 	 * @covers SimpleORM\AbstractDataMapper::findById | 
            
                                                                                                            
                            
            
                                    
            
            
                | 60 |  |  | 	 * @todo   Implement testFindById(). | 
            
                                                                                                            
                            
            
                                    
            
            
                | 61 |  |  | 	 */ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 62 |  |  | 	public function testFindById() | 
            
                                                                                                            
                            
            
                                    
            
            
                | 63 |  |  | 	{ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 64 |  |  | 		// Remove the following lines when you implement this test. | 
            
                                                                                                            
                            
            
                                    
            
            
                | 65 |  |  | 		$this->markTestIncomplete( | 
            
                                                                                                            
                            
            
                                    
            
            
                | 66 |  |  | 				'This test has not been implemented yet.' | 
            
                                                                                                            
                            
            
                                    
            
            
                | 67 |  |  | 		); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 68 |  |  | 	} | 
            
                                                                                                            
                            
            
                                    
            
            
                | 69 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 70 |  |  | 	/** | 
            
                                                                                                            
                            
            
                                    
            
            
                | 71 |  |  | 	 * @covers SimpleORM\AbstractDataMapper::save | 
            
                                                                                                            
                            
            
                                    
            
            
                | 72 |  |  | 	 * @todo   Implement testSave(). | 
            
                                                                                                            
                            
            
                                    
            
            
                | 73 |  |  | 	 */ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 74 |  |  | 	public function testSave() | 
            
                                                                                                            
                            
            
                                    
            
            
                | 75 |  |  | 	{ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 76 |  |  | 		// Remove the following lines when you implement this test. | 
            
                                                                                                            
                            
            
                                    
            
            
                | 77 |  |  | 		$this->markTestIncomplete( | 
            
                                                                                                            
                            
            
                                    
            
            
                | 78 |  |  | 				'This test has not been implemented yet.' | 
            
                                                                                                            
                            
            
                                    
            
            
                | 79 |  |  | 		); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 80 |  |  | 	} | 
            
                                                                                                            
                            
            
                                    
            
            
                | 81 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 82 |  |  | 	/** | 
            
                                                                                                            
                            
            
                                    
            
            
                | 83 |  |  | 	 * @covers SimpleORM\AbstractDataMapper::findBySpecification | 
            
                                                                                                            
                            
            
                                    
            
            
                | 84 |  |  | 	 * @todo   Implement testFindBySpecification(). | 
            
                                                                                                            
                            
            
                                    
            
            
                | 85 |  |  | 	 */ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 86 |  |  | 	public function testFindBySpecification() | 
            
                                                                                                            
                            
            
                                    
            
            
                | 87 |  |  | 	{ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 88 |  |  | 		// Remove the following lines when you implement this test. | 
            
                                                                                                            
                            
            
                                    
            
            
                | 89 |  |  | 		$this->markTestIncomplete( | 
            
                                                                                                            
                            
            
                                    
            
            
                | 90 |  |  | 				'This test has not been implemented yet.' | 
            
                                                                                                            
                            
            
                                    
            
            
                | 91 |  |  | 		); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 92 |  |  | 	} | 
            
                                                                                                            
                            
            
                                    
            
            
                | 93 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 94 |  |  | 	/** | 
            
                                                                                                            
                            
            
                                    
            
            
                | 95 |  |  | 	 * @covers SimpleORM\AbstractDataMapper::delete | 
            
                                                                                                            
                            
            
                                    
            
            
                | 96 |  |  | 	 * @todo   Implement testDelete(). | 
            
                                                                                                            
                            
            
                                    
            
            
                | 97 |  |  | 	 */ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 98 |  |  | 	public function testDelete() | 
            
                                                                                                            
                            
            
                                    
            
            
                | 99 |  |  | 	{ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 100 |  |  | 		// Remove the following lines when you implement this test. | 
            
                                                                                                            
                            
            
                                    
            
            
                | 101 |  |  | 		$this->markTestIncomplete( | 
            
                                                                                                            
                            
            
                                    
            
            
                | 102 |  |  | 				'This test has not been implemented yet.' | 
            
                                                                                                            
                            
            
                                    
            
            
                | 103 |  |  | 		); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 104 |  |  | 	} | 
            
                                                                                                            
                            
            
                                    
            
            
                | 105 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 106 |  |  | 	/** | 
            
                                                                                                            
                            
            
                                    
            
            
                | 107 |  |  | 	 * @covers SimpleORM\AbstractDataMapper::findAllBySpecification | 
            
                                                                                                            
                            
            
                                    
            
            
                | 108 |  |  | 	 * @todo   Implement testFindAllBySpecification(). | 
            
                                                                                                            
                            
            
                                    
            
            
                | 109 |  |  | 	 */ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 110 |  |  | 	public function testFindAllBySpecification() | 
            
                                                                                                            
                            
            
                                    
            
            
                | 111 |  |  | 	{ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 112 |  |  | 		// Remove the following lines when you implement this test. | 
            
                                                                                                            
                            
            
                                    
            
            
                | 113 |  |  | 		$this->markTestIncomplete( | 
            
                                                                                                            
                            
            
                                    
            
            
                | 114 |  |  | 				'This test has not been implemented yet.' | 
            
                                                                                                            
                            
            
                                    
            
            
                | 115 |  |  | 		); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 116 |  |  | 	} | 
            
                                                                                                            
                            
            
                                    
            
            
                | 117 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 118 |  |  | 	/** | 
            
                                                                                                            
                            
            
                                    
            
            
                | 119 |  |  | 	 * @covers SimpleORM\AbstractDataMapper::findAll | 
            
                                                                                                            
                            
            
                                    
            
            
                | 120 |  |  | 	 * @todo   Implement testFindAll(). | 
            
                                                                                                            
                            
            
                                    
            
            
                | 121 |  |  | 	 */ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 122 |  |  | 	public function testFindAll() | 
            
                                                                                                            
                            
            
                                    
            
            
                | 123 |  |  | 	{ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 124 |  |  | 		// Remove the following lines when you implement this test. | 
            
                                                                                                            
                            
            
                                    
            
            
                | 125 |  |  | 		$this->markTestIncomplete( | 
            
                                                                                                            
                            
            
                                    
            
            
                | 126 |  |  | 				'This test has not been implemented yet.' | 
            
                                                                                                            
                            
            
                                    
            
            
                | 127 |  |  | 		); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 128 |  |  | 	} | 
            
                                                                                                            
                            
            
                                    
            
            
                | 129 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 130 |  |  | 	/** | 
            
                                                                                                            
                            
            
                                    
            
            
                | 131 |  |  | 	 * @covers SimpleORM\AbstractDataMapper::useJoins | 
            
                                                                                                            
                            
            
                                    
            
            
                | 132 |  |  | 	 * @todo   Implement testUseJoins(). | 
            
                                                                                                            
                            
            
                                    
            
            
                | 133 |  |  | 	 */ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 134 |  |  | 	public function testUseJoins() | 
            
                                                                                                            
                            
            
                                    
            
            
                | 135 |  |  | 	{ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 136 |  |  | 		// Remove the following lines when you implement this test. | 
            
                                                                                                            
                            
            
                                    
            
            
                | 137 |  |  | 		$this->markTestIncomplete( | 
            
                                                                                                            
                            
            
                                    
            
            
                | 138 |  |  | 				'This test has not been implemented yet.' | 
            
                                                                                                            
                            
            
                                    
            
            
                | 139 |  |  | 		); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 140 |  |  | 	} | 
            
                                                                                                            
                            
            
                                    
            
            
                | 141 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 142 |  |  | 	/** | 
            
                                                                                                            
                            
            
                                    
            
            
                | 143 |  |  | 	 * @covers SimpleORM\AbstractDataMapper::withDelete | 
            
                                                                                                            
                            
            
                                    
            
            
                | 144 |  |  | 	 * @todo   Implement testWithDelete(). | 
            
                                                                                                            
                            
            
                                    
            
            
                | 145 |  |  | 	 */ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 146 |  |  | 	public function testWithDelete() | 
            
                                                                                                            
                            
            
                                    
            
            
                | 147 |  |  | 	{ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 148 |  |  | 		// Remove the following lines when you implement this test. | 
            
                                                                                                            
                            
            
                                    
            
            
                | 149 |  |  | 		$this->markTestIncomplete( | 
            
                                                                                                            
                            
            
                                    
            
            
                | 150 |  |  | 				'This test has not been implemented yet.' | 
            
                                                                                                            
                            
            
                                    
            
            
                | 151 |  |  | 		); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 152 |  |  | 	} | 
            
                                                                                                            
                                                                
            
                                    
            
            
                | 153 |  |  | } | 
            
                                                        
            
                                    
            
            
                | 154 |  |  |  | 
            
                        
Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.
The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.
This check looks for comments that seem to be mostly valid code and reports them.