Esempio n. 1
0
 /**
  * Test case
  */
 public function testGetContent()
 {
     $resource = new Enlight_Components_Snippet_Resource($this->manager);
     $this->engine->registerResource('snippet', $resource);
     $this->assertEquals('test', $this->engine->fetch('snippet:string:{s name="test" namespace="test"}test{/s}'));
     $this->assertEquals('test', $this->engine->fetch('snippet:string:{namespace name="test"}{s name="test"}test{/s}'));
     $this->assertEquals('force', $this->engine->fetch('snippet:string:{s name="force" namespace="test" force}force{/s}'));
     $this->assertEquals('force2', $this->engine->fetch('snippet:string:{s name="force" namespace="test" force}force2{/s}'));
     $this->assertContains('<span', $this->engine->fetch('snippet:string:{se name="force" namespace="test"}force{/se}'));
     $this->assertEquals('test', $this->engine->fetch('snippet:string:{namespace name="ignore"}{s name="ignore"}test{/s}'));
     $this->assertEquals('ignore', $this->engine->fetch('snippet:string:{namespace ignore}{s name="ignore"}ignore{/s}'));
 }