photos wip - almost there

This commit is contained in:
2025-08-22 00:41:57 -07:00
parent 803e161a9a
commit 9636cc9091
3 changed files with 43 additions and 5 deletions

View File

@@ -22,7 +22,7 @@ class ProductPhotosFixture extends TestFixture
'id' => '2c386086-f4c5-4093-bea5-ee9c29479f58',
'product_id' => 'cfc98a9a-29b2-44c8-b587-8156adc05317',
'product_sku_id' => null,
'photo_dir' => '/products/cfc98a9a-29b2-44c8-b587-8156adc05317/',
'photo_dir' => 'cfc98a9a-29b2-44c8-b587-8156adc05317',
'photo_filename' => '2c386086-f4c5-4093-bea5-ee9c29479f58.png',
'primary_photo' => 1,
'photo_position' => 100,

View File

@@ -347,4 +347,28 @@ class ProductPhotosControllerTest extends BaseControllerTest
$cntAfter = $this->ProductPhotos->find()->count();
$this->assertEquals($cntBefore - 1, $cntAfter);
}
/**
* Test image method
*
* Tests the image action with a logged in user
*
* @return void
* @throws Exception
*
* @uses ProductPhotosController::image
*/
public function testImageGetLoggedIn(): void
{
$id = '2c386086-f4c5-4093-bea5-ee9c29479f58';
// $this->loginUserByRole('admin');
$url = [
'plugin' => 'CakeProducts',
'controller' => 'ProductPhotos',
'action' => 'image',
$id,
];
$this->get($url);
$this->assertResponseCode(200);
}
}