/** * Tests whether adding a template has the desired effect. * * @covers phpDocumentor\Transformer\Transformer::addTemplate * @covers phpDocumentor\Transformer\Transformer::getTransformations * * @return void */ public function testAddTemplate() { $this->fixture->setTemplatesPath(dirname(__FILE__) . '/../../../../data/templates'); $this->fixture->addTemplate('responsive'); $this->assertGreaterThan(0, count($this->fixture->getTransformations()), 'Transformations should be added'); try { $this->fixture->addTemplate('wargarbl'); $this->fail('Expected an exception to be thrown when ' . 'supplying a non-existent template'); } catch (\InvalidArgumentException $e) { // this is good; exception is thrown } catch (\Exception $e) { $this->fail('An unknown exception has occurred when supplying a ' . 'non-existent template: ' . $e->getMessage()); } }