Completed
Push — develop ( ebe2d3...7bc0c1 )
by Oyebanji Jacob
02:13
created
test/ModelTest.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@  discard block
 block discarded – undo
14 14
 
15 15
 	protected $sqlStatement;
16 16
 
17
-	public function setUp(){
17
+	public function setUp() {
18 18
 		
19 19
 
20 20
 		$databaseConnectionStringFactory =
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
         $this->sqlStatement = m::mock('\PDOStatement');
29 29
 
30 30
         /*$this->databaseConnection = m::mock('Pyjac\ORM\DatabaseConnection[getInstance,createConnection]',array($databaseConnectionStringFactory));*/
31
-        $this->model =  $this->getMockForAbstractClass('Pyjac\ORM\Model',[$this->databaseConnection]);
31
+        $this->model = $this->getMockForAbstractClass('Pyjac\ORM\Model', [$this->databaseConnection]);
32 32
         //= new DatabaseConnection($databaseConnectionStringFactory);
33 33
 	}
34 34
 
@@ -37,9 +37,9 @@  discard block
 block discarded – undo
37 37
     	$this->databaseConnection->shouldReceive('createConnection')->with('sqlite::memory:')->once()->andReturn("");
38 38
         $this->model->expects($this->any())
39 39
              ->method('getTableName')
40
-             ->will($this->returnValue(strtolower(get_class($this->model).'s')));
40
+             ->will($this->returnValue(strtolower(get_class($this->model) . 's')));
41 41
 
42
-        $this->assertEquals($this->model->getTableName(), strtolower(get_class($this->model).'s'));
42
+        $this->assertEquals($this->model->getTableName(), strtolower(get_class($this->model) . 's'));
43 43
     }
44 44
 
45 45
     public function testGetReturnsAnObjectWhenIdIsFoundInDatabase()
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
     {
70 70
     	$this->databaseConnection->shouldReceive('prepare')->once()->andReturn($this->sqlStatement);
71 71
     	$this->sqlStatement->shouldReceive('execute');
72
-    	$this->sqlStatement->shouldReceive('fetchAll')->once()->andReturn([new stdClass,new stdClass]);
72
+    	$this->sqlStatement->shouldReceive('fetchAll')->once()->andReturn([new stdClass, new stdClass]);
73 73
     	$this->assertContainsOnlyInstancesOf('stdClass', $this->model->all());
74 74
     }
75 75
 
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
 
105 105
     public function testSaveShouldUpdateModelInDatabaseIfIdIsPresent()
106 106
     {
107
-    	$this->model->setProperties(['id' => 2,'name' => 'pyjac', 'age' => '419']);
107
+    	$this->model->setProperties(['id' => 2, 'name' => 'pyjac', 'age' => '419']);
108 108
     	$this->databaseConnection->shouldReceive('prepare')->once()->andReturn($this->sqlStatement);
109 109
     	$this->sqlStatement->shouldReceive('execute');
110 110
     	$this->sqlStatement->shouldReceive('rowCount')->once()->andReturn(1);
@@ -140,7 +140,7 @@  discard block
 block discarded – undo
140 140
 	    $this->model->age = '60';
141 141
 
142 142
 	    $this->assertEquals($this->model->name, 'Pyjac');
143
-	    $this->assertEquals($this->model->id , '10');
143
+	    $this->assertEquals($this->model->id, '10');
144 144
 	    $this->assertEquals($this->model->age, '60');
145 145
 	}
146 146
 
Please login to merge, or discard this patch.