andela-joyebanji /
PotatoORM
These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
| 1 | <?php |
||
| 2 | |||
| 3 | use Pyjac\ORM\Model; |
||
| 4 | |||
| 5 | class ModelTest extends PHPUnit_Framework_TestCase |
||
| 6 | { |
||
| 7 | protected $model; |
||
| 8 | |||
| 9 | public function setUp(){ |
||
| 10 | $this->model = $this->getMockForAbstractClass('Pyjac\ORM\Model'); |
||
| 11 | } |
||
| 12 | |||
| 13 | View Code Duplication | public function testGetTableNameReturnsCorrectTableName() |
|
|
0 ignored issues
–
show
|
|||
| 14 | { |
||
| 15 | $this->model->expects($this->any()) |
||
| 16 | ->method('getTableName') |
||
| 17 | ->will($this->returnValue(strtolower(get_class($stub).'s'))); |
||
|
0 ignored issues
–
show
|
|||
| 18 | |||
| 19 | $this->assertEquals($stub->getTableName(), strtolower(get_class($stub).'s')); |
||
| 20 | } |
||
| 21 | |||
| 22 | View Code Duplication | public function testGetTableNameReturnsCorrectTableName() |
|
|
0 ignored issues
–
show
This method seems to be duplicated in your project.
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation. You can also find more detailed suggestions in the “Code” section of your repository. Loading history...
|
|||
| 23 | { |
||
| 24 | $this->model->expects($this->any()) |
||
| 25 | ->method('getTableName') |
||
| 26 | ->will($this->returnValue(strtolower(get_class($stub).'s'))); |
||
|
0 ignored issues
–
show
|
|||
| 27 | |||
| 28 | $this->assertEquals($stub->getTableName(), strtolower(get_class($stub).'s')); |
||
| 29 | } |
||
| 30 | |||
| 31 | } |
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.