Completed
Push — develop ( 5df781...b9059c )
by Oyebanji Jacob
02:09
created

test/ModelTest.php (4 issues)

Upgrade to new PHP Analysis Engine

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
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...
14
    {
15
        $this->model->expects($this->any())
16
             ->method('getTableName')
17
             ->will($this->returnValue(strtolower(get_class($stub).'s')));
0 ignored issues
show
The variable $stub does not exist. Did you forget to declare it?

This check marks access to variables or properties that have not been declared yet. While PHP has no explicit notion of declaring a variable, accessing it before a value is assigned to it is most likely a bug.

Loading history...
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
The variable $stub does not exist. Did you forget to declare it?

This check marks access to variables or properties that have not been declared yet. While PHP has no explicit notion of declaring a variable, accessing it before a value is assigned to it is most likely a bug.

Loading history...
27
28
        $this->assertEquals($stub->getTableName(), strtolower(get_class($stub).'s'));
29
    }
30
31
}