/** * Tests the dump() method without any items or entity set. */ public function testDumpWithoutItemsOrEntity() { if (!method_exists($this->filesystem, 'dumpFile')) { $this->markTestSkipped('Test skipped as Filesystem::dumpFile() is not available in this version.'); } $this->setExpectedException('\\LogicException', 'An entity should be set OR you should use setItems() first'); // Given $this->service->setRootDir('/unit/test/'); $this->service->setFilename('feed.rss'); $this->service->setDirection('ASC'); $feed = $this->getMockBuilder('Eko\\FeedBundle\\Feed\\Feed')->disableOriginalConstructor()->getMock(); $feed->expects($this->once())->method('hasItems')->will($this->returnValue(true)); $this->feedManager->expects($this->once())->method('get')->will($this->returnValue($feed)); // When - Expects exception $this->service->dump(); }