/** @test */ function it_gives_us_the_author_name() { $author = new \PlatziPHP\Author('email', '1234', 'AUTOR_DE_PLATZI'); $author->setName('Hector', 'Flores'); $post = new \PlatziPHP\Post($author, 'A Title', 'A post body'); $this->assertEquals('by Hector', $post->getAuthor()); }
/** @test */ function Muestrame_el_nombre_del_autor() { $author = new \PlatziPHP\Author('*****@*****.**', 'crispi007', 'AUTOR_DE_PLATZI'); $author->name('Marc', 'Gimenez'); $post = new \PlatziPHP\Post($author, 'Un titulo', 'un cuerpo'); $this->assertEquals('by Marc', $post->getAuthor()); }
/** * @test */ function it_gives_us_the_author_name_in_post() { $author = new PlatziPHP\Author("*****@*****.**", "fake", "AUTOR_DE_PLATZI"); $author->setLastname('vargas'); $post = new PlatziPHP\Post($author, 'titulo', 'este es el body'); $this->assertEquals('', $post->getAuthor()); }
/** @test */ function it_give_user_the_author_name() { $autor = new \PlatziPHP\Author('*****@*****.**', 'platzi', 'AUTOR_DE_PLATZI'); $autor->setName('jesus', 'HERRERA'); $post = new \PlatziPHP\Post($autor, 'titulo', 'body'); $this->assertEquals('by jesus', $post->getAuthor()); }
/** @test */ function it_gives_us_the_author_name() { // It creates and object $author from the Author class and // send as params three strings. $author = new \PlatziPHP\Author('email', '1234', 'AUTOR_DE_PLATZI'); // Sets the Name for the $author $author->setName('Juan', 'Roa'); // Creates an object $post of the Post class and // send as params: $author and two strings $post = new \PlatziPHP\Post($author, 'A Title', 'A post body'); // Verifies that the assert equals to $post->getAuthor() $this->assertEquals('by Juan', $post->getAuthor()); }
/** * @test */ function it_returns_the_author() { $author = new \PlatziPHP\Author("*****@*****.**", '123456', 'AUTOR_DE_PLATZI'); $post = new \PlatziPHP\Post($author, 'My first Post', 'This is the content of my firstPost'); $this->assertInstanceOf(PlatziPHP\Author::class, $post->getAuthor()); }