REDROOM
PHP 8.2.31
Path:
Logout
Edit File
Size: 3.10 KB
Close
//opt/alt/php55/usr/share/pear/test/Config/Symfony/Component/Config/Tests/Definition/Builder/NumericNodeDefinitionTest.php
Text
Base64
<?php /* * This file is part of the Symfony package. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Config\Tests\Definition\Builder; use Symfony\Component\Config\Definition\Builder\IntegerNodeDefinition as NumericNodeDefinition; use Symfony\Component\Config\Definition\Builder\IntegerNodeDefinition; use Symfony\Component\Config\Definition\Builder\FloatNodeDefinition; class NumericNodeDefinitionTest extends \PHPUnit_Framework_TestCase { /** * @expectedException \InvalidArgumentException * @expectedExceptionMessage You cannot define a min(4) as you already have a max(3) */ public function testIncoherentMinAssertion() { $def = new NumericNodeDefinition('foo'); $def->max(3)->min(4); } /** * @expectedException \InvalidArgumentException * @expectedExceptionMessage You cannot define a max(2) as you already have a min(3) */ public function testIncoherentMaxAssertion() { $node = new NumericNodeDefinition('foo'); $node->min(3)->max(2); } /** * @expectedException \Symfony\Component\Config\Definition\Exception\InvalidConfigurationException * @expectedExceptionMessage The value 4 is too small for path "foo". Should be greater than or equal to 5 */ public function testIntegerMinAssertion() { $def = new IntegerNodeDefinition('foo'); $def->min(5)->getNode()->finalize(4); } /** * @expectedException \Symfony\Component\Config\Definition\Exception\InvalidConfigurationException * @expectedExceptionMessage The value 4 is too big for path "foo". Should be less than or equal to 3 */ public function testIntegerMaxAssertion() { $def = new IntegerNodeDefinition('foo'); $def->max(3)->getNode()->finalize(4); } public function testIntegerValidMinMaxAssertion() { $def = new IntegerNodeDefinition('foo'); $node = $def->min(3)->max(7)->getNode(); $this->assertEquals(4, $node->finalize(4)); } /** * @expectedException \Symfony\Component\Config\Definition\Exception\InvalidConfigurationException * @expectedExceptionMessage The value 400 is too small for path "foo". Should be greater than or equal to 500 */ public function testFloatMinAssertion() { $def = new FloatNodeDefinition('foo'); $def->min(5E2)->getNode()->finalize(4e2); } /** * @expectedException \Symfony\Component\Config\Definition\Exception\InvalidConfigurationException * @expectedExceptionMessage The value 4.3 is too big for path "foo". Should be less than or equal to 0.3 */ public function testFloatMaxAssertion() { $def = new FloatNodeDefinition('foo'); $def->max(0.3)->getNode()->finalize(4.3); } public function testFloatValidMinMaxAssertion() { $def = new FloatNodeDefinition('foo'); $node = $def->min(3.0)->max(7e2)->getNode(); $this->assertEquals(4.5, $node->finalize(4.5)); } }
Save
Close
Exit & Reset
Text mode: syntax highlighting auto-detects file type.
Directory Contents
Dirs: 0 × Files: 6
Delete Selected
Select All
Select None
Sort:
Name
Size
Modified
Enable drag-to-move
Name
Size
Perms
Modified
Actions
ArrayNodeDefinitionTest.php
6.74 KB
lrw-r--r--
2019-12-18 11:24:05
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
EnumNodeDefinitionTest.php
1.21 KB
lrw-r--r--
2019-12-18 11:24:05
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
ExprBuilderTest.php
6.24 KB
lrw-r--r--
2019-12-18 11:24:05
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
NodeBuilderTest.php
2.67 KB
lrw-r--r--
2019-12-18 11:24:05
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
NumericNodeDefinitionTest.php
3.10 KB
lrw-r--r--
2019-12-18 11:24:05
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
TreeBuilderTest.php
4.20 KB
lrw-r--r--
2019-12-18 11:24:05
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Zip Selected
If ZipArchive is unavailable, a
.tar
will be created (no compression).