/
dimamir
/
Wsdl_PackageGenerator
Обзор
Документация
Войти
/
dimamir
/
Wsdl_PackageGenerator
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
develop
tests/File/Validation/ChoiceRuleTest.php
55 строк
2 KB
Mikaël DELSOL
issue #274 - Fix validation on scalar contained by array
20 фев 2023, 19:55
Не верифицирован
20 фев 2023, 19:55
a31d48e
Код
Авторство
О чём код?
<?php declare(strict_types=1); namespace WsdlToPhp\PackageGenerator\Tests\File\Validation; /** * @internal * @coversDefaultClass */ final class ChoiceRuleTest extends AbstractRule { /** * - choice: StringValue | BinaryValue * - choiceMaxOccurs: 1 * - choiceMinOccurs: 1. */ public function testSetStringValueAfterBinaryValueMustThrowAnException(): void { $this->expectException(\InvalidArgumentException::class); $this->expectExceptionMessage('The property StringValue can\'t be set as the property BinaryValue is already set. Only one property must be set among these properties: StringValue, BinaryValue.'); $instance = self::getQueueMessageAttributeValueInstance(); $instance ->setBinaryValue('1234567980') ->setStringValue('0987654321') ; } /** * - choice: StringValue | BinaryValue * - choiceMaxOccurs: 1 * - choiceMinOccurs: 1. */ public function testSetStringValueAloneMustPass(): void { $instance = self::getQueueMessageAttributeValueInstance(true); $this->assertSame($instance, $instance->setStringValue('0987654321')); } /** * - choice: StringValue | BinaryValue * - choiceMaxOccurs: 1 * - choiceMinOccurs: 1. */ public function testSetStringValueAloneWithNullMustPass(): void { // true to avoid having the instance modified previously $instance = self::getQueueMessageAttributeValueInstance(true); $this->assertSame($instance, $instance->setStringValue(null)); } }