Skip to content
Snippets Groups Projects
Commit 5245fb22 authored by Hanne Moa's avatar Hanne Moa
Browse files

Add easy tests for SimpleSAML/Locale/Translate

parent d34d2e09
No related branches found
No related tags found
No related merge requests found
<?php
namespace SimpleSAML\Test\Locale;
use SimpleSAML\Locale\Translate;
class TranslateTest extends \PHPUnit_Framework_TestCase
{
/**
* Test SimpleSAML\Locale\Translate::noop().
*/
public function testNoop()
{
// test default
$c = \SimpleSAML_Configuration::loadFromArray(array());
$t = new Translate($c);
$testString = 'Blablabla';
$this->assertEquals($testString, $t->noop($testString));
}
/**
* Test SimpleSAML\Locale\Translate::t().
*/
public function testTFallback()
{
$c = \SimpleSAML_Configuration::loadFromArray(array());
$t = new Translate($c);
$testString = 'Blablabla';
// $fallbackdefault = true
$result = 'not translated ('.$testString.')';
$this->assertEquals($result, $t->t($testString));
// $fallbackdefault = false, should be a noop
$this->assertEquals($testString, $t->t($testString, array(), false));
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment