Example #1
0
 /** @test */
 public function classExistsThrowsAnExceptionIfAssertionDoesNotHold()
 {
     try {
         Tx_PtExtbase_Assertions_Assert::classExists('Tx_PtExtbase_Tests_Unit_Assertion_AssertTestNONEXISTING', array('message' => 'This throws an exception'));
     } catch (Exception $e) {
         return;
     }
     $this->fail('We should get an exception, as we wanted to assert the existence of a non-existent class.');
 }
 /**
  * Build and return the renderer
  *
  * @param Tx_PtExtlist_Domain_Configuration_Renderer_RendererConfig $rendererConfiguration
  * @return Tx_PtExtlist_Domain_Renderer_ConfigurableRendererInterface
  */
 public function getRenderer(Tx_PtExtlist_Domain_Configuration_Renderer_RendererConfig $rendererConfiguration)
 {
     $rendererClassName = $rendererConfiguration->getRendererClassName();
     Tx_PtExtbase_Assertions_Assert::classExists($rendererClassName, array('message' => 'Configured renderer class ' . $rendererClassName . ' does not exist! 1286986512'));
     $renderer = $this->objectManager->get($rendererClassName);
     /* @var $renderer Tx_PtExtlist_Domain_Renderer_ConfigurableRendererInterface */
     Tx_PtExtbase_Assertions_Assert::isTrue(is_a($renderer, 'Tx_PtExtlist_Domain_Renderer_ConfigurableRendererInterface'), array('message' => 'Configured renderer class ' . $rendererClassName . ' does not implement Tx_PtExtlist_Domain_Renderer_RendererInterface 1286986513'));
     $renderer->_injectConfiguration($rendererConfiguration);
     $renderer->initRenderer();
     return $renderer;
 }