register_stream_wrapper() public method

Register the stream wrapper for s3
 public function test_rename_via_stream_wrapper_fails_on_invalid_permission()
 {
     copy(dirname(__FILE__) . '/data/canola.jpg', 's3://' . S3_UPLOADS_BUCKET . '/canola.jpg');
     stream_wrapper_unregister('s3');
     $uploads = new S3_Uploads(S3_UPLOADS_BUCKET, S3_UPLOADS_KEY, '123', null, S3_UPLOADS_REGION);
     $uploads->register_stream_wrapper();
     $bucket_root = strtok(S3_UPLOADS_BUCKET, '/');
     $result = @rename('s3://' . S3_UPLOADS_BUCKET . '/canola.jpg', 's3://' . $bucket_root . '/canola.jpg');
     $this->assertFalse($result);
 }
 /**
  * As s3 doesn't have directories, we expect that mkdir does not cause any s3
  * connectivity.
  */
 public function test_file_exists_on_dir_does_not_cause_network_activity()
 {
     stream_wrapper_unregister('s3');
     $uploads = new S3_Uploads(S3_UPLOADS_BUCKET, S3_UPLOADS_KEY, '123');
     $uploads->register_stream_wrapper();
     $bucket_root = strtok(S3_UPLOADS_BUCKET, '/');
     // result would fail as we don't have permission to write here.
     $result = file_exists('s3://' . $bucket_root . '/some_dir');
     $this->assertTrue($result);
     $result = is_dir('s3://' . $bucket_root . '/some_dir');
     $this->assertTrue($result);
 }