Esempio n. 1
0
 public function testPostThumbnail()
 {
     $post = Post::find(59);
     $this->assertTrue($post->thumbnail->attachment instanceof Corcel\Attachment);
     $this->assertContains('hoodie_6_front.jpg', $post->image);
     $this->assertContains('/uploads/', $post->image);
 }
Esempio n. 2
0
 public function testInsertCustomFields()
 {
     $post = new Post();
     $post->save();
     $post->meta->username = '******';
     $post->meta->url = 'http://grossi.io';
     $post->save();
     $post = Post::find($post->ID);
     $this->assertEquals($post->meta->username, 'juniorgrossi');
     $this->assertEquals($post->meta->url, 'http://grossi.io');
 }
Esempio n. 3
0
 public function testAuthorFields()
 {
     $post = Post::find(1);
     $this->assertEquals($post->author->display_name, 'admin');
     $this->assertEquals($post->author->user_email, '*****@*****.**');
 }
Esempio n. 4
0
 public function testPostFormat()
 {
     $post = Post::find(3);
     $this->assertEquals('video', $post->getFormat());
     $post = Post::find(1);
     $this->assertFalse($post->getFormat());
 }