runPluginRefreshCommand('Database.Tester'); } public function testCreateFirstPost() { Post::truncate(); $post = new Post; $post->title = "First post"; $post->description = "Yay!!"; $post->save(); $this->assertEquals(1, $post->id); } public function testGuardedAttribute() { $this->expectException(\Illuminate\Database\Eloquent\MassAssignmentException::class); $this->expectExceptionMessageMatches('/title/'); Post::create(['title' => 'Hi!', 'slug' => 'authenticity']); } }