createCollectionAndFileModelWithImage(); $w = rand(10, 2000); $h = rand(10, 2000); $canv = rand(0, 1); $response = $this->loginAs()->getJson(route('api.files.show', ['collection_name' => $models['collection']->name, 'uuid' => $models['file']->uuid, 'extention' => $models['collection']->ext, 'w' => $w, 'h' => $h, 'canv' => $canv])); $response->assertOk()->assertHeader('content-type', $response->headers->get('content-type')); $this->assertEquals($w, getimagesize($response->getFile()->getPathname())[0]); $this->assertEquals($h, getimagesize($response->getFile()->getPathname())[1]); $this->deleteFakeImageForModel($models['file']); } // /** // * @testWith ["test", 4,'1:fgvjjf'] // * ["longer-string", 13,'1:fgvjjf'] // */ // public function test_user_send_not_currect_value_to_file($w, $h, $r) // { // $models = $this->createCollectionAndFileModelWithImage(); // $canv = rand(0, 1); // $response = $this->loginAs()->getJson(route('api.files.show', ['collection_name' => $models['collection']->name, 'uuid' => $models['file']->uuid, 'extention' => $models['collection']->ext, 'w' => $w, 'h' => $h, 'canv' => $canv])); // $response->assertOk()->assertHeader('content-type', $response->headers->get('content-type')); // $this->assertNotEquals($w, getimagesize($response->getFile()->getPathname())[0]); // $this->assertNotEquals($h, getimagesize($response->getFile()->getPathname())[1]); // $this->deleteFakeImageForModel($models['file']); // } }