예제 #1
0
 public function testManageCollection()
 {
     $cm = new CollectionManager();
     $cm->addCollection(new Collection('events', '_events', ['output' => true]));
     $cm->addCollection(new Collection('books', '_books', ['output' => true]));
     $this->assertInstanceOf('\\Yosymfony\\Spress\\Core\\ContentManager\\Collection\\CollectionInterface', $cm->getCollection('events'));
     $this->assertTrue($cm->hasCollection('events'));
     $this->assertEquals(3, $cm->countCollection());
     $cm->removeCollection('events');
     $this->assertEquals(2, $cm->countCollection());
     $cm->clearCollection();
     $this->assertEquals(0, $cm->countCollection());
 }