PHP code example of craue / translations-tests

1. Go to this page and download the library: Download craue/translations-tests library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

craue / translations-tests example snippets


// src/app/Tests/TranslationsTest.php
namespace Application\Tests;

use Craue\TranslationsTests\YamlTranslationsTest;

/**
 * @group unit
 */
class TranslationsTest extends YamlTranslationsTest {

	// only add this method to override the default implementation returning "en"
	protected function defineDefaultLocale() : string {
		return 'de';
	}

	// specify all locations with translation files
	protected function defineTranslationFiles() : array {
		return array_merge(
			glob(__DIR__ . '/../../Resources/translations/*.yml'),
			glob(__DIR__ . '/../../Resources/*Bundle/translations/*.yml'),
			glob(__DIR__ . '/../../../src/*/*Bundle/Resources/translations/*.yml')
		);
	}

}