Skip to content

Commit 27234b0

Browse files
committed
Added more tests
1 parent cf3efdf commit 27234b0

File tree

2 files changed

+33
-20
lines changed

2 files changed

+33
-20
lines changed

composer.lock

Lines changed: 15 additions & 15 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/Functional/LaravelModuleCest.php

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
use App\Utils\ToUppercase;
1414
use Illuminate\Contracts\Config\Repository as Config;
1515
use Illuminate\Contracts\Http\Kernel;
16+
use Illuminate\Database\Eloquent\Collection;
1617
use Illuminate\Foundation\Application;
1718
use Tests\FunctionalTester;
1819

@@ -38,7 +39,8 @@ public function amOnAction(FunctionalTester $I)
3839

3940
public function amOnRoute(FunctionalTester $I)
4041
{
41-
// TODO
42+
$I->amOnRoute('test-value');
43+
$I->see('Test value is');
4244
}
4345

4446
public function callArtisan(FunctionalTester $I)
@@ -183,7 +185,10 @@ public function grabService(FunctionalTester $I)
183185

184186
public function have(FunctionalTester $I)
185187
{
186-
// TODO
188+
$user = $I->have(User::class, ['email' => 'johndoe@example.com']);
189+
190+
$I->assertEquals('johndoe@example.com', $user->email);
191+
$I->seeRecord('users', ['email' => 'johndoe@example.com']);
187192
}
188193

189194
public function haveApplicationHandler(FunctionalTester $I)
@@ -231,7 +236,9 @@ public function haveInstance(FunctionalTester $I)
231236

232237
public function haveMultiple(FunctionalTester $I)
233238
{
234-
// TODO
239+
$I->haveMultiple(User::class, 3);
240+
241+
$I->seeNumRecords(4, User::class);
235242
}
236243

237244
public function haveRecord(FunctionalTester $I)
@@ -269,12 +276,18 @@ public function logout(FunctionalTester $I)
269276

270277
public function make(FunctionalTester $I)
271278
{
272-
// TODO
279+
/** @var Collection $collection */
280+
$collection = $I->make(User::class, ['email' => 'johndoe@example.com']);
281+
282+
$I->assertInstanceOf(User::class, $collection->first());
273283
}
274284

275285
public function makeMultiple(FunctionalTester $I)
276286
{
277-
// TODO
287+
/** @var Collection $collection */
288+
$collection = $I->makeMultiple(User::class, 3);
289+
290+
$I->assertSame(3, $collection->count());
278291
}
279292

280293
public function seeAuthentication(FunctionalTester $I)

0 commit comments

Comments
 (0)