mirror of
https://github.com/Karaka-Management/oms-ClientManagement.git
synced 2026-02-11 14:28:41 +00:00
add unit tests
This commit is contained in:
parent
baf370fbc8
commit
672273e43d
|
|
@ -290,7 +290,7 @@ class Client
|
||||||
/**
|
/**
|
||||||
* Get all media files by type
|
* Get all media files by type
|
||||||
*
|
*
|
||||||
* @param int $type Media type
|
* @param null|int $type Media type
|
||||||
*
|
*
|
||||||
* @return Media[]
|
* @return Media[]
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -56,7 +56,6 @@ trait ApiControllerClientTrait
|
||||||
$request->setData('country', ISO3166TwoEnum::_USA);
|
$request->setData('country', ISO3166TwoEnum::_USA);
|
||||||
|
|
||||||
$this->module->apiClientCreate($request, $response);
|
$this->module->apiClientCreate($request, $response);
|
||||||
|
|
||||||
self::assertGreaterThan(0, $response->get('')['response']->getId());
|
self::assertGreaterThan(0, $response->get('')['response']->getId());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -49,26 +49,4 @@ final class ClientMapperTest extends \PHPUnit\Framework\TestCase
|
||||||
self::assertGreaterThan(0, $client->getId());
|
self::assertGreaterThan(0, $client->getId());
|
||||||
self::assertEquals($id, $client->getId());
|
self::assertEquals($id, $client->getId());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @group volume
|
|
||||||
* @group module
|
|
||||||
* @coversNothing
|
|
||||||
*/
|
|
||||||
public function testClientVolume() : void
|
|
||||||
{
|
|
||||||
$profile = ProfileMapper::getFor(1, 'account');
|
|
||||||
$profile = $profile instanceof NullProfile ? new Profile() : $profile;
|
|
||||||
if ($profile->account->getId() === 0) {
|
|
||||||
$profile->account = new NullAccount(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
for ($i = 0; $i < 100; ++$i) {
|
|
||||||
$client = new Client();
|
|
||||||
$client->number = (string) \mt_rand(100000, 999999);
|
|
||||||
|
|
||||||
$client->profile = $profile;
|
|
||||||
ClientMapper::create($client);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" bootstrap="Bootstrap.php" colors="true" stopOnError="true" stopOnFailure="false" stopOnIncomplete="false" stopOnSkipped="false" beStrictAboutTestsThatDoNotTestAnything="false" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd">
|
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" bootstrap="Bootstrap.php" colors="true" columns="120" stopOnError="true" stopOnFailure="false" stopOnIncomplete="false" stopOnSkipped="false" beStrictAboutTestsThatDoNotTestAnything="false" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd">
|
||||||
<coverage includeUncoveredFiles="true" processUncoveredFiles="false">
|
<coverage includeUncoveredFiles="true" processUncoveredFiles="false">
|
||||||
<exclude>
|
<exclude>
|
||||||
<directory>*vendor*</directory>
|
<directory>*vendor*</directory>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user