mirror of
https://github.com/Karaka-Management/oms-Media.git
synced 2026-02-15 16:58:42 +00:00
test fixes
This commit is contained in:
parent
be3c3465c7
commit
ca27d3e374
|
|
@ -270,7 +270,7 @@ final class ApiController extends Controller
|
||||||
ApplicationAbstract $app = null
|
ApplicationAbstract $app = null
|
||||||
) : Media
|
) : Media
|
||||||
{
|
{
|
||||||
if ($status['status'] !== UploadStatus::OK) {
|
if (!isset($status['status']) || $status['status'] !== UploadStatus::OK) {
|
||||||
return new NullMedia();
|
return new NullMedia();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -696,7 +696,7 @@ final class ApiController extends Controller
|
||||||
$ids = [];
|
$ids = [];
|
||||||
foreach ($status as $stat) {
|
foreach ($status as $stat) {
|
||||||
$created = self::createDbEntry(
|
$created = self::createDbEntry(
|
||||||
$status,
|
$stat,
|
||||||
$request->header->account,
|
$request->header->account,
|
||||||
$virtualPath,
|
$virtualPath,
|
||||||
$request->getData('type', 'int'),
|
$request->getData('type', 'int'),
|
||||||
|
|
|
||||||
|
|
@ -119,6 +119,7 @@ trait ApiControllerCollectionTrait
|
||||||
$request->header->account = 1;
|
$request->header->account = 1;
|
||||||
$request->setData('name', 'Test Collection');
|
$request->setData('name', 'Test Collection');
|
||||||
$request->setData('path', '/test/path');
|
$request->setData('path', '/test/path');
|
||||||
|
$request->setData('create_directory', true);
|
||||||
|
|
||||||
$this->module->apiCollectionCreate($request, $response);
|
$this->module->apiCollectionCreate($request, $response);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -60,7 +60,18 @@ trait ApiControllerMediaTrait
|
||||||
],
|
],
|
||||||
];
|
];
|
||||||
|
|
||||||
$ids = $this->module->createDbEntries($status, 1);
|
$ids = [];
|
||||||
|
foreach ($status as $stat) {
|
||||||
|
$created = $this->module::createDbEntry(
|
||||||
|
$status,
|
||||||
|
1
|
||||||
|
);
|
||||||
|
|
||||||
|
if ($created->getId() > 0) {
|
||||||
|
$ids[] = $created->getId();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
self::assertCount(2, $ids);
|
self::assertCount(2, $ids);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user