/** * @param array $paths * @param int $expectedRows * @dataProvider pathsDataProvider */ public function testListContentsMeetsExpectedOutput(array $paths, $expectedRows) { foreach ($paths as $path) { if ($path['type'] == 'dir') { $this->adapter->createDir($path['name'], $this->emptyConfig); } else { $this->adapter->write($path['name'], '', $this->emptyConfig); } } // extraneous data to throw off the listings $this->adapter->createDir('/not/this', $this->emptyConfig); $this->adapter->createDir('/not/that', $this->emptyConfig); $this->adapter->write('/not/this/too.txt', '', $this->emptyConfig); $this->assertCount($expectedRows, $this->adapter->listContents('/test', true)); }
public function testListContentsWithDbFailure() { $this->setupBasicDbResponse(false); $listing = $this->adapter->listContents('/path'); $this->assertEmpty($listing); }