Skip to content

Commit 2c33ead

Browse files
committed
Rename tests
1 parent d7d2ed7 commit 2c33ead

5 files changed

Lines changed: 40 additions & 41 deletions

File tree

tests/KeyCollectionTest.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ public function tearDown()
1010
Mockery::close();
1111
}
1212

13-
public function testAllMethod()
13+
public function testAll()
1414
{
1515
$model = Mockery::mock(Model::class);
1616
$collection = new KeyCollection($model, [1, 2, 3]);
@@ -39,7 +39,7 @@ public function testIterator()
3939
$this->assertContainsOnlyInstancesOf(Model::class, $collection);
4040
}
4141

42-
public function testDiffMethod()
42+
public function testDiff()
4343
{
4444
$model = Mockery::mock(Model::class);
4545
$collection = new KeyCollection($model, [1, 2, 3]);
@@ -50,15 +50,15 @@ public function testDiffMethod()
5050
$this->assertArrayNotHasKey(3, $diff);
5151
}
5252

53-
public function testFirstMethod()
53+
public function testFirst()
5454
{
5555
$model = Mockery::mock(Model::class);
5656
$collection = new KeyCollection($model, [4, 5, 6]);
5757
$model->shouldReceive('read')->with(4)->once()->andReturnSelf();
5858
$this->assertInstanceOf(Model::class, $collection->first());
5959
}
6060

61-
public function testLastMethod()
61+
public function testLast()
6262
{
6363
$model = Mockery::mock(Model::class);
6464
$collection = new KeyCollection($model, [4, 5, 6]);
@@ -69,14 +69,14 @@ public function testLastMethod()
6969
/**
7070
* @expectedException \OutOfBoundsException
7171
*/
72-
public function testGetMethodThrowsOutOfBoundsException()
72+
public function testGetThrowsOutOfBoundsException()
7373
{
7474
$model = Mockery::mock(Model::class);
7575
$collection = new KeyCollection($model, [1]);
7676
$collection->get(2);
7777
}
7878

79-
public function testHasMethod()
79+
public function testHas()
8080
{
8181
$model = Mockery::mock(Model::class);
8282
$collection = new KeyCollection($model, [4, 5, '6A']);
@@ -86,7 +86,7 @@ public function testHasMethod()
8686
$this->assertFalse($collection->has(6));
8787
}
8888

89-
public function testIsEmptyMethod()
89+
public function testIsEmpty()
9090
{
9191
$model = Mockery::mock(Model::class);
9292
$collection = new KeyCollection($model, []);
@@ -136,7 +136,7 @@ public function testImmutableUnset()
136136
unset($collection[1]);
137137
}
138138

139-
public function testPaginateMethod()
139+
public function testPaginate()
140140
{
141141
$model = Mockery::mock(Model::class);
142142
$collection = new KeyCollection($model, [1, 2, 3, 4, 5, 6, 7, 8, 9]);
@@ -163,7 +163,7 @@ public function testReadOnEmptyCollection()
163163
$this->assertNull($collection->current());
164164
}
165165

166-
public function testPluckMethod()
166+
public function testPluck()
167167
{
168168
$model = Mockery::mock(Model::class);
169169
$collection = new KeyCollection($model, [1, 2]);
@@ -176,7 +176,7 @@ public function testPluckMethod()
176176
$this->assertEquals('Test 2', $list[1]);
177177
}
178178

179-
public function testPluckMethodWithKey()
179+
public function testPluckWithKey()
180180
{
181181
$model = Mockery::mock(Model::class);
182182
$collection = new KeyCollection($model, [1, 2]);

tests/ModelAttachmentsTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public function testGetContent()
3333
$this->assertEquals('Some random string', $model->getContent());
3434
}
3535

36-
public function testAttachFileMethod()
36+
public function testAttachFile()
3737
{
3838
$client = Mockery::mock(Client::class);
3939
$service = Mockery::mock(AttachmentService::class);

tests/ModelTest.php

Lines changed: 21 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
use Pace\Client;
55
use Pace\KeyCollection;
66
use Pace\XPath\Builder;
7-
use Pace\Services\AttachmentService;
87

98
class 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');

tests/TypeTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,19 @@
44

55
class TypeTest extends PHPUnit_Framework_TestCase
66
{
7-
public function testCamelizeMethod()
7+
public function testCamelize()
88
{
99
$this->assertEquals('csr', Type::camelize('CSR'));
1010
$this->assertEquals('jobPart', Type::camelize('JobPart'));
1111
}
1212

13-
public function testModelifyMethod()
13+
public function testModelify()
1414
{
1515
$this->assertEquals('GLBatch', Type::modelify('glBatch'));
1616
$this->assertEquals('SalesPerson', Type::modelify('salesPerson'));
1717
}
1818

19-
public function testSingularizeMethod()
19+
public function testSingularize()
2020
{
2121
$this->assertEquals('jobStatus', Type::singularize('jobStatus'));
2222
$this->assertEquals('jobStatus', Type::singularize('jobStatuses'));

tests/XPath/BuilderTest.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ public function testSorting()
8888
);
8989
}
9090

91-
public function testFindMethod()
91+
public function testFind()
9292
{
9393
$model = Mockery::mock(Model::class);
9494
$collection = Mockery::mock(KeyCollection::class);
@@ -104,7 +104,7 @@ public function testFindMethod()
104104
$this->assertInstanceOf(KeyCollection::class, $builder->find());
105105
}
106106

107-
public function testFirstOrNewMethodModelNotFound()
107+
public function testFirstOrNewModelNotFound()
108108
{
109109
$model = Mockery::mock(Model::class);
110110
$collection = Mockery::mock(KeyCollection::class);
@@ -114,7 +114,7 @@ public function testFirstOrNewMethodModelNotFound()
114114
$this->assertInstanceOf(Model::class, (new Builder($model))->firstOrNew());
115115
}
116116

117-
public function testFirstOrNewMethodModelFound()
117+
public function testFirstOrNewModelFound()
118118
{
119119
$model = Mockery::mock(Model::class);
120120
$collection = Mockery::mock(KeyCollection::class);
@@ -123,7 +123,7 @@ public function testFirstOrNewMethodModelFound()
123123
$this->assertInstanceOf(Model::class, (new Builder($model))->firstOrNew());
124124
}
125125

126-
public function testFirstOrFailMethod()
126+
public function testFirstOrFail()
127127
{
128128
$model = Mockery::mock(Model::class);
129129
$collection = Mockery::mock(KeyCollection::class);
@@ -135,7 +135,7 @@ public function testFirstOrFailMethod()
135135
/**
136136
* @expectedException \Pace\ModelNotFoundException
137137
*/
138-
public function testFirstOrFailMethodThrowsModelNotFoundException()
138+
public function testFirstOrFailThrowsModelNotFoundException()
139139
{
140140
$model = Mockery::mock(Model::class);
141141
$collection = Mockery::mock(KeyCollection::class);

0 commit comments

Comments
 (0)