We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c167bf9 commit a987769Copy full SHA for a987769
1 file changed
tests/Commands/User/CheckUserEmailExistTest.php
@@ -0,0 +1,27 @@
1
+<?php
2
+
3
+namespace Tests\Commands;
4
5
+use App\User;
6
+use Illuminate\Foundation\Testing\RefreshDatabase;
7
+use Tests\TestCase;
8
9
+class CheckUserEmailExistTest extends TestCase {
10
11
+ public function testItFindsEmailInApidbUsersTable() {
12
+ User::factory()->create([
13
+ 'email' => 'user@example.com',
14
+ ]);
15
16
+ // Act & Assert
17
+ $this->artisan('wbs-user:check-email', ['emails' => ['user@example.com']])
18
+ ->expectsOutput('FOUND: user@example.com in apidb.users')
19
+ ->assertExitCode(0);
20
+ }
21
22
+ public function testItReturnsNotFoundIfEmailDoesNotExist() {
23
+ $this->artisan('wbs-user:check-email', ['emails' => ['nonexistent@example.com']])
24
+ ->expectsOutput('NOT FOUND: nonexistent@example.com')
25
26
27
+}
0 commit comments