Example #1
0
 /**
  * @test
  */
 public function it_creates_an_image()
 {
     $wps = new Sdk(['auth' => ['*****@*****.**', 'secret']]);
     $filePath = 'image-3.jpg';
     \WpsTest\MockSdk::createImage($filePath);
     $image = $wps->image()->create($filePath);
     unlink($filePath);
     $this->assertInstanceOf(Image::class, $image);
     return $image;
 }
Example #2
0
 /**
  * @test
  */
 public function it_creates_an_image()
 {
     $wps = new Sdk();
     $wps->addMockResults([new Response(200, [], json_encode($wps->imageResponse(3)))]);
     $filePath = 'image-3.jpg';
     $wps->createImage($filePath);
     $image = $wps->image()->create($filePath);
     unlink($filePath);
     $this->assertEquals(['/images/'], $wps->getRequestUris());
     $this->assertInstanceOf(Image::class, $image);
     $this->assertEquals([3, 'image-3.jpg'], [$image->id, $image->name]);
 }