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()); }
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')); }