44use Pace \Client ;
55use Pace \KeyCollection ;
66use Pace \XPath \Builder ;
7- use Pace \Services \AttachmentService ;
87
98class ModelTest extends PHPUnit_Framework_TestCase
109{
@@ -60,7 +59,7 @@ public function testExceptionIsThrownForEmptyKey()
6059 $ model ->key ();
6160 }
6261
63- public function testReadMethod ()
62+ public function testRead ()
6463 {
6564 $ client = Mockery::mock (Client::class);
6665 $ client ->shouldReceive ('readObject ' )->with ('CSR ' , 3 )->once ()->andReturn (['id ' => 3 ]);
@@ -71,14 +70,14 @@ public function testReadMethod()
7170 $ this ->assertTrue ($ read ->exists );
7271 }
7372
74- public function testReadMethodWithNullKey ()
73+ public function testReadWithNullKey ()
7574 {
7675 $ client = Mockery::mock (Client::class);
7776 $ model = new Model ($ client , 'CSR ' );
7877 $ this ->assertNull ($ model ->read (null ));
7978 }
8079
81- public function testReadOrFailMethod ()
80+ public function testReadOrFail ()
8281 {
8382 $ client = Mockery::mock (Client::class);
8483 $ client ->shouldReceive ('readObject ' )
@@ -92,15 +91,15 @@ public function testReadOrFailMethod()
9291 /**
9392 * @expectedException Pace\ModelNotFoundException
9493 */
95- public function testReadOrFailMethodThrowsModelNotFoundException ()
94+ public function testReadOrFailThrowsModelNotFoundException ()
9695 {
9796 $ client = Mockery::mock (Client::class);
9897 $ client ->shouldReceive ('readObject ' )->once ()->with ('SalesPerson ' , 5 )->andReturn (null );
9998 $ model = new Model ($ client , 'SalesPerson ' );
10099 $ model ->readOrFail (5 );
101100 }
102101
103- public function testBelongsToMethod ()
102+ public function testBelongsTo ()
104103 {
105104 $ client = Mockery::mock (Client::class);
106105 $ model = new Model ($ client , 'Job ' );
@@ -111,7 +110,7 @@ public function testBelongsToMethod()
111110 $ this ->assertEquals ($ related , $ model ->belongsTo ('CSR ' , 'csr ' ));
112111 }
113112
114- public function testBelongsToMethodWithCompoundKey ()
113+ public function testBelongsToWithCompoundKey ()
115114 {
116115 $ client = Mockery::mock (Client::class);
117116 $ model = new Model ($ client , 'JobMaterial ' );
@@ -123,7 +122,7 @@ public function testBelongsToMethodWithCompoundKey()
123122 $ this ->assertEquals ($ related , $ model ->belongsTo ('JobPart ' , 'job:jobPart ' ));
124123 }
125124
126- public function testHasManyMethod ()
125+ public function testHasMany ()
127126 {
128127 $ client = Mockery::mock (Client::class);
129128 $ model = new Model ($ client , 'Job ' );
@@ -137,7 +136,7 @@ public function testHasManyMethod()
137136 $ this ->assertInstanceOf (KeyCollection::class, $ builder ->get ());
138137 }
139138
140- public function testHasManyMethodWithCompoundKey ()
139+ public function testHasManyWithCompoundKey ()
141140 {
142141 $ client = Mockery::mock (Client::class);
143142 $ model = new Model ($ client , 'JobPart ' );
@@ -154,7 +153,7 @@ public function testHasManyMethodWithCompoundKey()
154153 $ this ->assertInstanceOf (KeyCollection::class, $ builder ->get ());
155154 }
156155
157- public function testMorphManyMethod ()
156+ public function testMorphMany ()
158157 {
159158 $ client = Mockery::mock (Client::class);
160159 $ model = new Model ($ client , 'Job ' );
@@ -171,7 +170,7 @@ public function testMorphManyMethod()
171170 $ this ->assertInstanceOf (KeyCollection::class, $ builder ->get ());
172171 }
173172
174- public function testIsDirtyMethod ()
173+ public function testIsDirty ()
175174 {
176175 $ client = Mockery::mock (Client::class);
177176 $ model = new Model ($ client , 'CSR ' , ['name ' => 'John Smith ' ]);
@@ -180,7 +179,7 @@ public function testIsDirtyMethod()
180179 $ this ->assertTrue ($ model ->isDirty ());
181180 }
182181
183- public function testJoinKeysMethod ()
182+ public function testJoinKeys ()
184183 {
185184 $ client = Mockery::mock (Client::class);
186185 $ model = new Model ($ client , 'CSR ' );
@@ -244,7 +243,7 @@ public function testSaveOnNewModel()
244243 $ this ->assertFalse ($ model ->isDirty ());
245244 }
246245
247- public function testCreateMethod ()
246+ public function testCreate ()
248247 {
249248 $ client = Mockery::mock (Client::class);
250249 $ attributes = [
@@ -261,23 +260,23 @@ public function testCreateMethod()
261260 $ this ->assertInstanceOf (Model::class, $ model ->create ($ attributes ));
262261 }
263262
264- public function testSplitKeyMethod ()
263+ public function testSplitKey ()
265264 {
266265 $ client = Mockery::mock (Client::class);
267266 $ model = new Model ($ client , 'JobPart ' , ['primaryKey ' => '12345:01 ' ]);
268267 $ this ->assertEquals (['12345 ' , '01 ' ], $ model ->splitKey ());
269268 $ this ->assertEquals (['job ' , 'jobPart ' ], $ model ->splitKey ('job:jobPart ' ));
270269 }
271270
272- public function testGetDirtyMethod ()
271+ public function testGetDirty ()
273272 {
274273 $ client = Mockery::mock (Client::class);
275274 $ model = new Model ($ client , 'CSR ' , ['name ' => 'John Smith ' , 'email ' => 'jsmith@printcompany.com ' ]);
276275 $ model ->email = 'john.smith@printcompany.com ' ;
277276 $ this ->assertEquals (['email ' => 'john.smith@printcompany.com ' ], $ model ->getDirty ());
278277 }
279278
280- public function testDuplicateMethod ()
279+ public function testDuplicate ()
281280 {
282281 $ client = Mockery::mock (Client::class);
283282 $ attributes = [
@@ -306,7 +305,7 @@ public function testDuplicateMethod()
306305 $ this ->assertNull ($ model ->duplicate ());
307306 }
308307
309- public function testDuplicateMethodWithNewKey ()
308+ public function testDuplicateWithNewKey ()
310309 {
311310 $ client = Mockery::mock (Client::class);
312311 $ attributes = [
@@ -353,15 +352,15 @@ public function testMagicHasMany()
353352 $ this ->assertEquals ($ builder , $ model ->jobParts ());
354353 }
355354
356- public function testCallBuilderMethod ()
355+ public function testCallBuilder ()
357356 {
358357 $ client = Mockery::mock (Client::class);
359358 $ model = new Model ($ client , 'Job ' );
360359 $ builder = $ model ->filter ('@active ' , true );
361360 $ this ->assertInstanceOf (Builder::class, $ builder );
362361 }
363362
364- public function testGetTypeMethod ()
363+ public function testGetType ()
365364 {
366365 $ client = Mockery::mock (Client::class);
367366 $ model = new Model ($ client , 'GLAccount ' );
@@ -376,7 +375,7 @@ public function testCastToString()
376375 $ this ->assertEquals (json_encode ($ attributes ), $ model );
377376 }
378377
379- public function testDeleteMethod ()
378+ public function testDelete ()
380379 {
381380 $ client = Mockery::mock (Client::class);
382381 $ client ->shouldReceive ('deleteObject ' )->with ('CSR ' , 3 )->once ()->andReturnNull ();
@@ -388,7 +387,7 @@ public function testDeleteMethod()
388387 $ this ->assertNull ($ model ->delete ());
389388 }
390389
391- public function testFreshMethod ()
390+ public function testFresh ()
392391 {
393392 $ client = Mockery::mock (Client::class);
394393 $ client ->shouldReceive ('readObject ' )
@@ -406,7 +405,7 @@ public function testFreshMethod()
406405 $ this ->assertNull ($ model ->fresh ());
407406 }
408407
409- public function testFindMethod ()
408+ public function testFind ()
410409 {
411410 $ client = Mockery::mock (Client::class);
412411 $ model = new Model ($ client , 'CSR ' );
0 commit comments