Skip to content
This repository was archived by the owner on Jul 31, 2018. It is now read-only.

Commit 713bfb2

Browse files
authored
Merge pull request #136 from techinasia/cleanup-tests
Cleanup Tests
2 parents 5a9118b + 7f8fd3d commit 713bfb2

File tree

5 files changed

+7
-14
lines changed

5 files changed

+7
-14
lines changed

tests/AlgoliaEloquentTraitTest.php

+3-9
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,6 @@ public function testSetSettings()
9999
$this->assertEquals($modelHelper->getFinalIndexName($model12, $realModelHelper->getSettings($model12)['slaves'][0]), 'model_6_desc_testing');
100100

101101
$model12->setSettings();
102-
103-
104102
}
105103

106104
public function testSetSettingsMerge()
@@ -175,7 +173,8 @@ public function testSetSynonyms()
175173
$this->assertEquals(null, $model10->setSettings());
176174
}
177175

178-
function testPustToIndexWithgetAlgoliaRecordAndIndexName() {
176+
public function testPushToIndexWithGetAlgoliaRecordAndIndexName()
177+
{
179178
/** @var \AlgoliaSearch\Laravel\ModelHelper $realModelHelper */
180179
$realModelHelper = App::make('\AlgoliaSearch\Laravel\ModelHelper');
181180

@@ -193,13 +192,8 @@ function testPustToIndexWithgetAlgoliaRecordAndIndexName() {
193192
App::instance('\AlgoliaSearch\Laravel\ModelHelper', $modelHelper);
194193

195194

196-
$index->shouldReceive('addObject')->times(1)->with(["is" => "working", "objectID" => null]);
195+
$index->shouldReceive('addObject')->times(1)->with(['is' => 'working', 'objectID' => null]);
197196

198197
$this->assertEquals(null, (new Model11())->pushToIndex());
199198
}
200-
201-
public function tearDown()
202-
{
203-
Mockery::close();
204-
}
205199
}

tests/EloquentSubscriberTest.php

-4
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
use AlgoliaSearch\Laravel\EloquentSubscriber;
66
use AlgoliaSearch\Tests\Models\Model1;
77

8-
98
class EloquentSubscriberTest extends \PHPUnit_Framework_TestCase
109
{
1110
/**
@@ -57,7 +56,4 @@ public function listenerDataProvider()
5756
['eloquent.event', [new Model1()]], // Laravel 5.4
5857
];
5958
}
60-
61-
62-
6359
}

tests/ModelHelperTest.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ public function setUp()
2525

2626
$this->modelHelper = $this->app->make('\AlgoliaSearch\Laravel\ModelHelper');
2727
}
28+
2829
public function testAutoIndexAndAutoDelete()
2930
{
3031
$this->assertEquals(true, $this->modelHelper->isAutoIndex(new Model1()));
@@ -77,7 +78,7 @@ public function testGetIndices()
7778

7879
$indices = $this->modelHelper->getIndices(new Model2());
7980

80-
$this->assertEquals(2, count($indices));
81+
$this->assertCount(2, $indices);
8182
$this->assertEquals('index1', $indices[0]->indexName);
8283
}
8384
}

tests/Models/Model10.php

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
class Model10 extends Model
88
{
99
use AlgoliaEloquentTrait;
10+
1011
public $algoliaSettings = [
1112
'synonyms' => [
1213
[

tests/Models/Model11.php

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ public function getAlgoliaRecord($indexName)
1414
if ($indexName == 'model11s') {
1515
return ["is" => "working"];
1616
}
17+
1718
return ["is not" => "working"];
1819
}
1920
}

0 commit comments

Comments
 (0)