Guest User

Untitled

a guest
Jan 21st, 2019
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.11 KB | None | 0 0
  1. <?php
  2.  
  3. use FakerGenerator as Faker;
  4. use IlluminateDatabaseEloquentModel;
  5.  
  6. $factory->define(AppRecord::class, function (Faker $faker) {
  7. return [
  8. "name" => $faker->name,
  9. ];
  10. });
  11.  
  12. <?php
  13. namespace App;
  14. use AppProduct;
  15. use IlluminateDatabaseEloquentModel;
  16.  
  17. class Record extends Model
  18. {
  19. protected $table = "records";
  20.  
  21. protected $fillable = ["name"];
  22.  
  23. function __construct()
  24. {
  25. parent::__construct();
  26. }
  27. }
  28.  
  29. <?php
  30.  
  31. namespace TestsFeature;
  32.  
  33. use TestsTestCase;
  34. use IlluminateFoundationTestingWithoutMiddleware;
  35. use IlluminateFoundationTestingDatabaseMigrations;
  36. use IlluminateFoundationTestingDatabaseTransactions;
  37. use IlluminateFoundationTestingRefreshDatabase;
  38.  
  39. use App;
  40. use AppProduct;
  41. use AppRecord;
  42. use AppUser;
  43.  
  44. class RecordTest extends TestCase
  45. {
  46. use RefreshDatabase;
  47. use WithoutMiddleware;
  48.  
  49. /** @test */
  50. public function when_record_page_for_existing_record_is_accessed_then_a_product_is_displayed()
  51. {
  52. //$record = factory(AppRecord::class)->make();
  53. $record = factory(AppRecord::class)->create();
  54. echo "nn$record->namenn";
  55.  
  56. }
  57. }
  58.  
  59. $record->name
Add Comment
Please, Sign In to add comment