for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* File containing the class GlobCollectorTest extends \PHPUnit_Framework_TestCase
class.
*
* @copyright Copyright (C) eZ Systems AS. All rights reserved.
* @license For full copyright and license information view LICENSE file distributed with this source code.
*/
namespace eZ\Bundle\EzPublishCoreBundle\Tests\Translation;
use eZ\Bundle\EzPublishCoreBundle\Translation\GlobCollector;
class GlobCollectorTest extends \PHPUnit_Framework_TestCase
{
public function testCollect()
$translationRootDir = str_replace(
sprintf('%1$sTests%1$sTranslation', DIRECTORY_SEPARATOR),
sprintf('%1$sTests%1$sResources%1$sTranslation%1$svendor', DIRECTORY_SEPARATOR),
__DIR__
);
$collector = new GlobCollector($translationRootDir);
$files = $collector->collect();
$this->assertEquals(3, count($files));
foreach ($files as $file) {
$this->assertTrue(in_array($file['domain'], ['messages', 'dashboard']));
$this->assertTrue(in_array($file['locale'], ['fr', 'ach_UG']));
$this->assertEquals($file['format'], 'xlf');
}