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

ModelTest::setUp()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 1 Features 1
Metric Value
c 1
b 1
f 1
dl 0
loc 3
rs 10
cc 1
eloc 2
nc 1
nop 0
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
Duplication introduced by
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
Bug introduced by
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
Duplication introduced by
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
Bug introduced by
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
}