-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
begin Call endpoint with CMS reference
- Loading branch information
1 parent
336845d
commit 431642e
Showing
4 changed files
with
98 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
<?php | ||
|
||
namespace Alma\API\Tests\Unit\Legacy\Lib; | ||
|
||
use Alma\API\Exceptions\ParametersException; | ||
use Alma\API\Lib\InsuranceValidator; | ||
use PHPUnit\Framework\TestCase; | ||
|
||
class InsuranceValidatorTest extends TestCase | ||
{ | ||
|
||
|
||
/** | ||
* @dataProvider checkCmsReferenceInvalidPayloadDataProvider | ||
* @param $invalidPayload | ||
* @return void | ||
* @throws ParametersException | ||
*/ | ||
public function testCheckCmsReferenceWithInvalidPayloadThrowParameterException($invalidPayload) | ||
{ | ||
$this->expectException(ParametersException::class); | ||
$insuranceValidator = new InsuranceValidator(); | ||
$insuranceValidator->checkCmsReference($invalidPayload); | ||
} | ||
|
||
public function checkCmsReferenceInvalidPayloadDataProvider() | ||
{ | ||
return [ | ||
'String payload' => | ||
[ | ||
'payload' => 'mb-024, mb-048' | ||
], | ||
'Empty string payload' => | ||
[ | ||
'payload' => '' | ||
], | ||
'Object payload' => | ||
[ | ||
'payload' => new \stdClass() | ||
], | ||
'Empty array' => | ||
[ | ||
'payload' => [] | ||
], | ||
'Int payload' => | ||
[ | ||
'payload' => 123 | ||
], | ||
'Bool payload' => [ | ||
'payload' => true | ||
], | ||
'Object payload in array' => [ | ||
'payload' => ['1236', new \stdClass()] | ||
], | ||
]; | ||
}} |