/
dimamir
/
Wsdl_PackageGenerator
Обзор
Документация
Войти
/
dimamir
/
Wsdl_PackageGenerator
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
develop
tests/File/Validation/IntRuleTest.php
60 строк
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 IntRuleTest extends AbstractRule { public function testSetDecimalPlacesValueWithStringValueMustThrowAnException(): void { $this->expectException(\TypeError::class); $instance = self::getWhlTaxTypeInstance(); $instance->setDecimalPlaces('foo'); } public function testSetDecimalPlacesValueWithIntValueMustPass(): void { $instance = self::getWhlTaxTypeInstance(); $this->assertSame($instance, $instance->setDecimalPlaces(18)); } public function testSetDecimalPlacesValueWithStringIntValueMustPass(): void { $instance = self::getWhlTaxTypeInstance(); $this->assertSame($instance, $instance->setDecimalPlaces(18)); } public function testSetDecimalPlacesValueWithFloatValueMustThrowAnException(): void { $this->expectException(\TypeError::class); $instance = self::getWhlTaxTypeInstance(); $instance->setDecimalPlaces(18.5); } public function testSetDecimalPlacesValueWithStringFloatValueMustThrowAnException(): void { $this->expectException(\TypeError::class); $instance = self::getWhlTaxTypeInstance(); $instance->setDecimalPlaces('18.5'); } public function testSetDecimalPlacesValueWithNullValueMustPass(): void { $instance = self::getWhlTaxTypeInstance(); $this->assertSame($instance, $instance->setDecimalPlaces(null)); } }