@@ -78,15 +78,23 @@ public function testListContents()
7878    {
7979        $ mock$ this getS3Client ();
8080        $ mockshouldReceive ('listObjects ' )->once ()->andReturn (Mockery::self ());
81-         $ resultarray ('Contents '  => array (array ('Key '  => 'path ' , 'ContentLength '  => 20 , 'ContentType '  => 'text/plain ' )));
81+         $ resultarray ('Contents '  => array (
82+             array ('Key '  => 'path ' , 'ContentLength '  => 20 , 'ContentType '  => 'text/plain ' ),
83+             array ('Key '  => 'path/to/dir/ ' ),
84+         ));
8285        $ mockshouldReceive ('getAll ' )->with (array ('Contents ' ))->andReturn ($ result
8386        $ adapternew  Adapter ($ mock'bucketname ' );
8487        $ listing$ adapterlistContents ();
85-         $ this assertCount (1 , $ listing
86-         $ itemreset ($ listing
87-         $ this assertArrayHasKey ('path ' , $ item
88-         $ this assertArrayHasKey ('type ' , $ item
89-         $ this assertArrayHasKey ('mimetype ' , $ item
88+         $ this assertCount (2 , $ listing
89+         $ firstreset ($ listing
90+         $ this assertArrayHasKey ('path ' , $ first
91+         $ this assertArrayHasKey ('type ' , $ first
92+         $ this assertArrayHasKey ('mimetype ' , $ first
93+         $ lastend ($ listing
94+         $ this assertArrayHasKey ('path ' , $ first
95+         $ this assertArrayHasKey ('type ' , $ first
96+         $ this assertEquals ($ last'type ' ], 'dir ' );
97+ 
9098    }
9199
92100    public  function  testSetVisibility ()
@@ -158,6 +166,15 @@ public function testCreateDir()
158166        $ this assertEquals ('dir ' , $ result'type ' ]);
159167    }
160168
169+     public  function  testCreateDirFail ()
170+     {
171+         $ mock$ this getS3Client ();
172+         $ mockshouldReceive ('putObject ' )->andReturn (false );
173+         $ adapternew  Adapter ($ mock'bucketname ' );
174+         $ result$ adaptercreateDir ('something ' );
175+         $ this assertFalse ($ result
176+     }
177+ 
161178    public  function  testRead ()
162179    {
163180        $ mock$ this getS3Client ();
0 commit comments