Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- use FakerGenerator as Faker;
- use IlluminateDatabaseEloquentModel;
- $factory->define(AppRecord::class, function (Faker $faker) {
- return [
- "name" => $faker->name,
- ];
- });
- <?php
- namespace App;
- use AppProduct;
- use IlluminateDatabaseEloquentModel;
- class Record extends Model
- {
- protected $table = "records";
- protected $fillable = ["name"];
- function __construct()
- {
- parent::__construct();
- }
- }
- <?php
- namespace TestsFeature;
- use TestsTestCase;
- use IlluminateFoundationTestingWithoutMiddleware;
- use IlluminateFoundationTestingDatabaseMigrations;
- use IlluminateFoundationTestingDatabaseTransactions;
- use IlluminateFoundationTestingRefreshDatabase;
- use App;
- use AppProduct;
- use AppRecord;
- use AppUser;
- class RecordTest extends TestCase
- {
- use RefreshDatabase;
- use WithoutMiddleware;
- /** @test */
- public function when_record_page_for_existing_record_is_accessed_then_a_product_is_displayed()
- {
- //$record = factory(AppRecord::class)->make();
- $record = factory(AppRecord::class)->create();
- echo "nn$record->namenn";
- }
- }
- $record->name
Add Comment
Please, Sign In to add comment