/
dimamir
/
Wsdl_PackageGenerator
Обзор
Документация
Войти
/
dimamir
/
Wsdl_PackageGenerator
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
develop
tests/Container/PhpElement/ConstantTest.php
36 строк
940 B
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\Container\PhpElement; use WsdlToPhp\PackageGenerator\Container\PhpElement\Constant; use WsdlToPhp\PackageGenerator\Tests\AbstractTestCase; use WsdlToPhp\PhpGenerator\Element\PhpConstant; use WsdlToPhp\PhpGenerator\Element\PhpMethod; /** * @internal * @coversDefaultClass */ final class ConstantTest extends AbstractTestCase { public function testAdd(): void { $constant = new Constant(self::getBingGeneratorInstance()); $constant->add(new PhpConstant('foo', 1)); $this->assertCount(1, $constant); $this->assertInstanceOf(PhpConstant::class, $constant->get('foo')); } public function testAddWithException(): void { $this->expectException(\InvalidArgumentException::class); $constant = new Constant(self::getBingGeneratorInstance()); $constant->add(new PhpMethod('Bar')); } }