Hello, world! ]]> '; /** * @var Context */ private $Context; /** * Prepares the environment before running a test. */ protected function setUp() { parent::setUp(); $this->GadgetSpecParser = new GadgetSpecParser(); $this->Context = new GadgetContext('GADGET'); } /** * Cleans up the environment after running a test. */ protected function tearDown() { $this->GadgetSpecParser = null; parent::tearDown(); } /** * Tests GadgetSpecParser->parse() exception */ public function testParseExeption() { $this->setExpectedException('SpecParserException'); $this->assertTrue($this->GadgetSpecParser->parse('', $this->Context)); } /** * Tests GadgetSpecParser->parse() */ public function testParse() { $gadgetParsed = $this->GadgetSpecParser->parse($this->Gadget, $this->Context); $views = $gadgetParsed->getViews(); $this->assertEquals('

Hello, world!

', trim($views[DEFAULT_VIEW]->getContent())); } }