Skip to content

Commit 0c6a77f

Browse files
committed
updated few test cases.
1 parent 3676167 commit 0c6a77f

File tree

2 files changed

+19
-17
lines changed

2 files changed

+19
-17
lines changed

tests/BaseTestCase.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@ public function setup()
1414
$this->setUpDatabase();
1515
}
1616

17-
// protected function getPackageProviders($app)
18-
// {
19-
// return [
20-
// \Thecodework\TwoFactorAuthentication\TwoFactorAuthenticationServiceProvider::class,
21-
// ];
22-
// }
17+
protected function getPackageProviders($app)
18+
{
19+
return [
20+
\Thecodework\TwoFactorAuthentication\TwoFactorAuthenticationServiceProvider::class,
21+
];
22+
}
2323

2424
protected function seedUserDetails()
2525
{

tests/TwoFactorAuthenticationTest.php

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,24 @@
22

33
namespace Thecodework\TwoFactorAuthentication\Tests;
44

5+
use Illuminate\Http\Request;
6+
use Illuminate\Support\Facades\Schema;
7+
use Thecodework\TwoFactorAuthentication\Http\Controllers\TwoFactorAuthenticationController;
8+
59
class TwoFactorAuthenticationTest extends BaseTestCase
610
{
7-
/**
8-
* Test Users count after inserting one row.
9-
*
10-
* @test
11-
*/
12-
public function getUsers()
11+
protected $user;
12+
13+
public function testUserId()
1314
{
14-
$this->assertEquals(\DB::table('users')->count(), 1);
15+
$this->user = \DB::table('users')->first();
16+
$this->assertEquals(1, $this->user->id);
1517
}
1618

17-
protected function getPackageProviders($app)
19+
public function testIfColumnExists()
1820
{
19-
return [
20-
'Thecodework\TwoFactorAuthentication\TwoFactorAuthenticationServiceProvider',
21-
];
21+
$this->assertTrue(Schema::hasColumn(config('2fa-config.table'), 'two_factor_secret_key'));
22+
$this->assertTrue(Schema::hasColumn(config('2fa-config.table'), 'is_two_factor_enabled'));
2223
}
24+
2325
}

0 commit comments

Comments
 (0)