Skip to content

Commit 5bdd21b

Browse files
committed
Added tests
1 parent c167bf9 commit 5bdd21b

1 file changed

Lines changed: 25 additions & 0 deletions

File tree

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<?php
2+
3+
namespace Tests\Commands;
4+
5+
use App\User;
6+
use Tests\TestCase;
7+
8+
class CheckUserEmailExistTest extends TestCase {
9+
public function testItFindsEmailInApidbUsersTable() {
10+
User::factory()->create([
11+
'email' => 'user@example.com',
12+
]);
13+
14+
// Act & Assert
15+
$this->artisan('wbs-user:check-email', ['emails' => ['user@example.com']])
16+
->expectsOutput('FOUND: user@example.com in apidb.users')
17+
->assertExitCode(0);
18+
}
19+
20+
public function testItReturnsNotFoundIfEmailDoesNotExist() {
21+
$this->artisan('wbs-user:check-email', ['emails' => ['nonexistent@example.com']])
22+
->expectsOutput('NOT FOUND: nonexistent@example.com')
23+
->assertExitCode(0);
24+
}
25+
}

0 commit comments

Comments
 (0)