Guest User

Untitled

a guest
Jan 21st, 2019
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.96 KB | None | 0 0
  1. [RuntimeException] Call to undefined method UnitTester::haveRecord
  2.  
  3. <?php namespace Article;
  4. use AppArticle;
  5. use FakerFactory as Faker;
  6. use CarbonCarbon;
  7. class SaveTest extends CodeceptionTestUnit
  8. {
  9. /**
  10. * @var UnitTester
  11. */
  12. protected $tester;
  13.  
  14. protected function _before()
  15. {
  16. }
  17.  
  18. protected function _after()
  19. {
  20. }
  21.  
  22. // tests
  23. public function testSomeFeature()
  24. {
  25. $faker= Faker::create('App/Article');
  26.  
  27. $title = $faker->sentence;
  28. $content = implode($faker->paragraphs(5));
  29. $created_at = Carbon::now();
  30. $updated_at = Carbon::now();
  31.  
  32.  
  33. $this->tester->haveRecord( 'Article', ['title' => $title, 'content' => $content,'created_at' => $created_at,'updated_at' => $updated_at]);
  34.  
  35.  
  36. $this->tester->seeRecord('articles',['title' => $title,'content' => $content,'created_at' => $created_at,'updated_at' => $updated_at]);
  37.  
  38.  
  39.  
  40.  
  41. }
  42. }
  43.  
  44. actor: UnitTester
  45. modules:
  46. enabled:
  47. - Asserts
  48. - Laravel5:
  49. part: ORM
  50. - HelperUnit
Add Comment
Please, Sign In to add comment