Ejemplo n.º 1
0
 /**
  * @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()));
 }
Ejemplo n.º 2
0
 /**
  * {@inheritdoc}
  */
 public function isDirectory($key)
 {
     return $this->master->isDirectory($key);
 }
Ejemplo n.º 3
0
 /**
  * {@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);
 }
Ejemplo n.º 5
0
 /**
  * @param \Gaufrette\Adapter $source
  */
 function it_should_delegate_is_directory_to_source($source)
 {
     $source->isDirectory('filename')->shouldBeCalled()->willReturn(true);
     $this->isDirectory('filename')->shouldReturn(true);
 }
Ejemplo n.º 6
0
 /**
  * @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);
 }