コード例 #1
0
 public function setUp()
 {
     parent::setUp();
     Config::set('filesystems.disks.s3.key', env('S3_KEY', 'key'));
     Config::set('filesystems.disks.s3.secret', env('S3_SECRET', 'secret'));
     Config::set('filesystems.disks.s3.region', env('S3_REGION', 'region'));
     Config::set('filesystems.disks.s3.bucket', env('S3_BUCKET', 'bucket'));
     Config::set('image.versions.disk', 's3');
     Config::set('image.versions.root_url', env('S3_ENDPOINT', 'endpoint'));
     Config::set('image.versions.namespace', 'igaster\\imageVersions\\Tests\\App\\Transformations');
     // -- Set  migrations
     Schema::create('photos', function ($table) {
         $table->increments('id');
         $table->string('filename');
     });
     Photo::create(['id' => 1, 'filename' => 'tests/image1.jpg']);
 }
コード例 #2
0
 public function setUp()
 {
     parent::setUp();
     Config::set('image.driver', 'gd');
     // set the public path to this directory
     App::bind('path.public', function () {
         return __DIR__ . '/public';
     });
     Config::set('filesystems.disks.local.root', public_path());
     // -- Set  migrations
     Schema::create('photos', function ($table) {
         $table->increments('id');
         $table->string('filename');
     });
     Photo::create(['id' => 1, 'filename' => 'image1.jpg']);
     Photo::create(['id' => 2, 'filename' => 'invalid.txt.jpg']);
     Photo::create(['id' => 3, 'filename' => 'subfolder/image3.jpg']);
 }