Author: Victor Puertas (vpgugr@gmail.com)
Inheritance: implements Yosymfony\Spress\Core\DataWriter\DataWriterInterface
Esempio n. 1
0
 public function testReParseSite()
 {
     $dw = new MemoryDataWriter();
     $spress = new Spress();
     $spress['spress.config.site_dir'] = __DIR__ . '/fixtures/project';
     $spress['spress.dataWriter'] = $dw;
     $spress->parse();
     $this->assertCount(17, $dw->getItems());
     $spress->parse();
     $this->assertCount(17, $dw->getItems());
 }
Esempio n. 2
0
 public function testWriteItem()
 {
     $item = new Item('Test content', 'my-id');
     $item->setPath('index.html', Item::SNAPSHOT_PATH_PERMALINK);
     $item->setPath('index.html', Item::SNAPSHOT_PATH_RELATIVE);
     $dw = new MemoryDataWriter();
     $dw->write($item);
     $this->assertTrue($dw->hasItem('index.html'));
     $this->assertEquals(1, $dw->countItems());
     $this->assertEquals('Test content', $dw->getItem('index.html')->getContent());
     $this->assertCount(1, $dw->getItems());
     $this->assertFalse($dw->hasItem('not-found-path.html'));
 }