public function testGetAvailableFormats() { $writer = $this->getMock('Exporter\\Writer\\TypedWriterInterface'); $writer->expects($this->once())->method('getFormat')->willReturn('whatever'); $exporter = new Exporter(array($writer)); $this->assertSame(array('whatever'), $exporter->getAvailableFormats()); }