!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/DoctrineBridge/Symfony/Bridge/Doctrine/Tests/Security/User/   drwxr-xr-x
Free 293.41 GB of 429.69 GB (68.28%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


Viewing file:     EntityUserProviderTest.php (3.47 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\Bridge\Doctrine\Tests\Security\User;

use 
Symfony\Bridge\Doctrine\Test\DoctrineTestHelper;
use 
Symfony\Bridge\Doctrine\Tests\Fixtures\User;
use 
Symfony\Bridge\Doctrine\Security\User\EntityUserProvider;
use 
Doctrine\ORM\Tools\SchemaTool;

class 
EntityUserProviderTest extends \PHPUnit_Framework_TestCase
{
    public function 
testRefreshUserGetsUserByPrimaryKey()
    {
        
$em DoctrineTestHelper::createTestEntityManager();
        
$this->createSchema($em);

        
$user1 = new User(11'user1');
        
$user2 = new User(12'user2');

        
$em->persist($user1);
        
$em->persist($user2);
        
$em->flush();

        
$provider = new EntityUserProvider($this->getManager($em), 'Symfony\Bridge\Doctrine\Tests\Fixtures\User''name');

        
// try to change the user identity
        
$user1->name 'user2';

        
$this->assertSame($user1$provider->refreshUser($user1));
    }

    public function 
testRefreshUserRequiresId()
    {
        
$em DoctrineTestHelper::createTestEntityManager();

        
$user1 = new User(nullnull'user1');
        
$provider = new EntityUserProvider($this->getManager($em), 'Symfony\Bridge\Doctrine\Tests\Fixtures\User''name');

        
$this->setExpectedException(
            
'InvalidArgumentException',
            
'You cannot refresh a user from the EntityUserProvider that does not contain an identifier. The user object has to be serialized with its own identifier mapped by Doctrine'
        
);
        
$provider->refreshUser($user1);
    }

    public function 
testRefreshInvalidUser()
    {
        
$em DoctrineTestHelper::createTestEntityManager();
        
$this->createSchema($em);

        
$user1 = new User(11'user1');

        
$em->persist($user1);
        
$em->flush();

        
$provider = new EntityUserProvider($this->getManager($em), 'Symfony\Bridge\Doctrine\Tests\Fixtures\User''name');

        
$user2 = new User(12'user2');
        
$this->setExpectedException(
            
'Symfony\Component\Security\Core\Exception\UsernameNotFoundException',
            
'User with id {"id1":1,"id2":2} not found'
        
);
        
$provider->refreshUser($user2);
    }

    public function 
testSupportProxy()
    {
        
$em DoctrineTestHelper::createTestEntityManager();
        
$this->createSchema($em);

        
$user1 = new User(11'user1');

        
$em->persist($user1);
        
$em->flush();
        
$em->clear();

        
$provider = new EntityUserProvider($this->getManager($em), 'Symfony\Bridge\Doctrine\Tests\Fixtures\User''name');

        
$user2 $em->getReference('Symfony\Bridge\Doctrine\Tests\Fixtures\User', array('id1' => 1'id2' => 1));
        
$this->assertTrue($provider->supportsClass(get_class($user2)));
    }

    private function 
getManager($em$name null)
    {
        
$manager $this->getMock('Doctrine\Common\Persistence\ManagerRegistry');
        
$manager->expects($this->once())
            ->
method('getManager')
            ->
with($this->equalTo($name))
            ->
will($this->returnValue($em));

        return 
$manager;
    }

    private function 
createSchema($em)
    {
        
$schemaTool = new SchemaTool($em);
        
$schemaTool->createSchema(array(
            
$em->getClassMetadata('Symfony\Bridge\Doctrine\Tests\Fixtures\User'),
        ));
    }
}

:: 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.1954 ]--