/** * @param \Gaufrette\Adapter $adapter */ function it_listing_directories_using_adapter_is_directory_method($adapter) { $keys = array('filename', 'filename1', 'filename2', 'testKey', 'KeyTest', 'testkey'); $adapter->keys()->willReturn($keys); $adapter->isDirectory('filename')->willReturn(false); $adapter->isDirectory('filename2')->willReturn(false); $adapter->isDirectory('KeyTest')->willReturn(false); $adapter->isDirectory('testkey')->willReturn(false); $adapter->isDirectory('filename1')->willReturn(true); $adapter->isDirectory('testKey')->willReturn(true); $this->listKeys()->shouldReturn(array('keys' => array('filename', 'filename2', 'KeyTest', 'testkey'), 'dirs' => array('filename1', 'testKey'))); $this->listKeys('filename')->shouldReturn(array('keys' => array('filename', 'filename2'), 'dirs' => array('filename1'))); $this->listKeys('Key')->shouldReturn(array('keys' => array('KeyTest'), 'dirs' => array())); }
/** * {@inheritdoc} */ public function isDirectory($key) { return $this->master->isDirectory($key); }
/** * {@inheritdoc} */ public function isDirectory($key) { return $this->source->isDirectory($key); }
/** * @param \Gaufrette\Adapter $adapter */ function it_delegates_directory_check($adapter) { $adapter->isDirectory('filename')->willReturn(true); $adapter->isDirectory('filename2')->willReturn(false); $this->isDirectory('filename')->shouldReturn(true); $this->isDirectory('filename2')->shouldReturn(false); }
/** * @param \Gaufrette\Adapter $source */ function it_should_delegate_is_directory_to_source($source) { $source->isDirectory('filename')->shouldBeCalled()->willReturn(true); $this->isDirectory('filename')->shouldReturn(true); }
/** * @param \Gaufrette\Adapter $adapter */ function it_should_decide_which_key_is_dir_using_adapter($adapter) { $keys = array('filename', 'filename1', 'filename2', 'testKey', 'KeyTest', 'testkey'); $adapter->keys()->willReturn($keys); $adapter->isDirectory('filename')->willReturn(false); $adapter->isDirectory('filename2')->willReturn(false); $adapter->isDirectory('KeyTest')->willReturn(false); $adapter->isDirectory('testkey')->willReturn(false); $adapter->isDirectory('filename1')->willReturn(true); $adapter->isDirectory('testKey')->willReturn(true); $this->listKeys()->shouldReturn(array('keys' => array('filename', 'filename2', 'KeyTest', 'testkey'), 'dirs' => array('filename1', 'testKey'))); $this->listKeys('filename')->shouldReturn(array('keys' => array('filename', 'filename2'), 'dirs' => array('filename1'))); $this->listKeys('Key')->shouldReturn(array('keys' => array('KeyTest'), 'dirs' => array('testKey'))); }
/** * {@inheritDoc} */ public function isDirectory($key) { return $this->primary->isDirectory($key) || $this->fallback->isDirectory($key); }