Ejemplo n.º 1
0
 public function testPostSlug()
 {
     Post::observe(new SlugObserver());
     $post = new Post();
     $post->save();
     $this->assertRegExp('/^[a-z0-9]{8}$/i', (string) $post->slug);
 }
Ejemplo n.º 2
0
 private function setupUserAndPost()
 {
     $user = new User();
     $user->firstName = 'Kirk';
     $user->lastName = 'Bushell';
     $user->save();
     $post = new Post();
     $post->userId = $user->id;
     $post->save();
     return compact('user', 'post');
 }