示例#1
0
 public function test_render_if_showing()
 {
     $post = DummyPost::find(1);
     $html = \Mural::render($post, 'test-room');
     $crawler = new Crawler($html);
     $this->assertEquals($crawler->filter('div[data-type = "Laravolt\\Mural\\Test\\DummyPost"]')->count(), 1);
     $this->assertEquals($crawler->filter('div[data-room = "test-room"]')->count(), 1);
     $this->assertContains($crawler->filter('.author')->text(), 'Heru');
     $this->assertContains('ago', $crawler->filter('.date')->text());
     $this->assertContains('My Comment 2', $crawler->filter('.media-body p')->eq(0)->text());
     $this->assertContains('My Comment 1', $crawler->filter('.media-body p')->eq(1)->text());
 }
示例#2
0
 public function test_get_comments()
 {
     $post = DummyPost::find(1);
     $comments = \Mural::getComments($post, 'test-room');
     $this->assertEquals($comments->count(), 2);
 }