Exemplo n.º 1
0
 /**
  * This test makes sure the resource class is compatible with Eloquent
  * models.
  *
  * @test
  */
 public function test_saves_and_retreives_records_from_the_database()
 {
     $post = Post::create(['title' => 'Post title', 'body' => 'Post body']);
     $storedPost = Post::where(['title' => 'Post title'])->first();
     $this->assertEquals($post->id, $storedPost->id);
 }
Exemplo n.º 2
0
 private function makePost($title)
 {
     $post = Post::create(['title' => $title, 'body' => 'Here is the post body']);
 }