-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
83 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?php | ||
|
||
namespace Tests\Feature; | ||
|
||
use Tests\TestCase; | ||
use Illuminate\Foundation\Testing\WithFaker; | ||
use Illuminate\Foundation\Testing\RefreshDatabase; | ||
|
||
class UserTest extends TestCase | ||
{ | ||
/** | ||
* A basic feature test example. | ||
* | ||
* @return void | ||
*/ | ||
public function testExample() | ||
{ | ||
$response = $this->get('/'); | ||
|
||
$response->assertStatus(200); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<?php | ||
|
||
namespace Tests\Unit; | ||
|
||
use Tests\TestCase; | ||
use Illuminate\Foundation\Testing\WithFaker; | ||
use Illuminate\Foundation\Testing\RefreshDatabase; | ||
use App\Record; | ||
|
||
class RecordTest extends TestCase | ||
{ | ||
/** | ||
* A basic unit test example. | ||
* | ||
* @return void | ||
*/ | ||
public function testRecords() | ||
{ | ||
// Assert that there is 5 records after the seed | ||
$this->assertEquals(5, Record::count()); | ||
|
||
// Select the first record | ||
$record_1 = Record::find(1)->get_attributes(); | ||
|
||
//fwrite(STDERR, print_r($record_1)); | ||
|
||
// Assert is has all the proper attributes | ||
$this->assertEquals(1, $record_1['id']); | ||
$this->assertTrue(array_key_exists('description', $record_1)); | ||
$this->assertTrue(array_key_exists('url', $record_1)); | ||
$this->assertTrue(array_key_exists('title', $record_1)); | ||
$this->assertTrue(array_key_exists('created_at', $record_1)); | ||
$this->assertTrue(array_key_exists('updated_at', $record_1)); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<?php | ||
|
||
namespace Tests\Unit; | ||
|
||
use Tests\TestCase; | ||
use Illuminate\Foundation\Testing\WithFaker; | ||
use Illuminate\Foundation\Testing\RefreshDatabase; | ||
|
||
class UserTest extends TestCase | ||
{ | ||
/** | ||
* A basic unit test example. | ||
* | ||
* @return void | ||
*/ | ||
public function testExample() | ||
{ | ||
$this->assertTrue(true); | ||
} | ||
} |