Carew\Tests\Command\BuildTest::testExecuteTags PHP Method

testExecuteTags() public method

public testExecuteTags ( )
    public function testExecuteTags()
    {
        $this->deleteDir($webDir = __DIR__ . '/fixtures/tags/web');
        $application = $this->runApplication(dirname($webDir));
        $this->assertSame(0, $application->getStatusCode());
        $this->assertTrue(file_exists($webDir . '/tags/index.html'));
        $crawler = new Crawler(file_get_contents($webDir . '/tags/index.html'));
        $this->assertSame('Tags', $crawler->filter('title')->text());
        $this->assertSame('Tags', $crawler->filter('h1')->text());
        $this->assertCount(1, $crawler->filter('ul'));
        $this->assertCount(3, $crawler->filter('li'));
        $this->assertTrue(file_exists($webDir . '/tags/tag1.html'));
        $crawler = new Crawler(file_get_contents($webDir . '/tags/tag1.html'));
        $this->assertSame('Tag #tag1', $crawler->filter('title')->text());
        $this->assertSame('Tag #tag1', $crawler->filter('h1')->text());
        $this->assertCount(1, $crawler->filter('ul'));
        $this->assertCount(5, $crawler->filter('li'));
        $this->assertTrue(file_exists($webDir . '/tags/tag2.html'));
        $crawler = new Crawler(file_get_contents($webDir . '/tags/tag2.html'));
        $this->assertSame('Tag #tag2', $crawler->filter('title')->text());
        $this->assertSame('Tag #tag2', $crawler->filter('h1')->text());
        $this->assertCount(1, $crawler->filter('ul'));
        $this->assertCount(5, $crawler->filter('li'));
        $this->assertTrue(file_exists($webDir . '/tags/tag3.html'));
        $crawler = new Crawler(file_get_contents($webDir . '/tags/tag3.html'));
        $this->assertSame('Tag #tag3', $crawler->filter('title')->text());
        $this->assertSame('Tag #tag3', $crawler->filter('h1')->text());
        $this->assertCount(1, $crawler->filter('ul'));
        $this->assertCount(4, $crawler->filter('li'));
        $this->deleteDir($webDir);
    }