-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #57 from vlad-ko/feature/enable-tests
adding a fake test
- Loading branch information
Showing
6 changed files
with
88 additions
and
16 deletions.
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
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,35 @@ | ||
<?php | ||
|
||
namespace Database\Factories; | ||
|
||
use App\Models\ImportantOne; | ||
use Illuminate\Database\Eloquent\Factories\Factory; | ||
use Illuminate\Support\Str; | ||
use Faker\Generator as Faker; | ||
|
||
class ImportantOneFactory extends Factory | ||
{ | ||
/** | ||
* The name of the factory's corresponding model. | ||
* | ||
* @var string | ||
*/ | ||
protected $model = ImportantOne::class; | ||
|
||
/** | ||
* Define the model's default state. | ||
* | ||
* @return array | ||
*/ | ||
public function definition() | ||
{ | ||
return [ | ||
'value' => 99, | ||
'status' => 'active', | ||
'created' => now(), | ||
'created_at' => now(), | ||
'object' => 'important_row', | ||
'transaction_id' => Str::random(10), | ||
]; | ||
} | ||
} |
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,26 @@ | ||
<?php | ||
|
||
namespace Tests\Unit; | ||
|
||
use Tests\TestCase; | ||
use Illuminate\Database\Eloquent\Factories\HasFactory; | ||
use Illuminate\Foundation\Testing\DatabaseMigrations; | ||
use Illuminate\Foundation\Testing\DatabaseTransactions; | ||
use App\Models\ImportantOne; | ||
|
||
class ImportantOneTest extends TestCase | ||
{ | ||
/** | ||
* A basic test example. | ||
* | ||
* @return void | ||
*/ | ||
|
||
public function testBrandNewFunctionHasNoTest() { | ||
|
||
$importantOne = ImportantOne::factory()->make(); | ||
$result = $importantOne->brandNewFunctionHasNoTest(); | ||
$this->assertEquals('we have data', $result); | ||
} | ||
|
||
} |