Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

i18n unit test


Go to End


1756 Views

Avatar
dacar

Community Member, 173 Posts

6 February 2010 at 5:07am

Hi, i have installed phpUnit and tried :http://localhost/test/dev/tests/i18nTextCollectorTest
Tere i get the following message. Can someone explain whats the error?
How can i make http://localhost/test/dev/tasks/i18nTextCollectorTask working properly?

i18nTextCollectorTest
dev→ tests→ i18nTextCollectorTest
⊗ I18n Text Collector Test::test Collect From Filesystem And Write Master Tables

Failed asserting that <text> contains "$lang['en_US']['i18nTestModule']['MAINTEMPLATE'] = 'Main Template';".

* PHPUnit_Framework_Constraint->fail(<?php global $lang; $lang['en_US']['i18nTestModule']['ADDITION'] = 'Addition'; $lang['en_US']['i18nTestModule']['ENTITY'] = array( 'Entity with "Double Quotes"', PR_LOW, 'Comment for entity' ); $lang['en_US']['i18nTestModule']['LAYOUTTEMPLATE'] = 'Layout Template'; $lang['en_US']['i18nTestModule']['OTHERENTITY'] = 'Other Entity'; $lang['en_US']['i18nTestModule']['PLURALNAME'] = array( 'I18n Test Moduls', 50, 'Pural name of the object, used in dropdowns and to generally identify a collection of this object in the interface' ); $lang['en_US']['i18nTestModule']['SINGULARNAME'] = array( 'I18n Test Module', 50, 'Singular name of the object, used in dropdowns and to generally identify a single object in the interface' ); $lang['en_US']['i18nTestModule']['SPRINTFNAMESPACE'] = 'My replacement: %s'; $lang['en_US']['i18nTestModule']['WITHNAMESPACE'] = 'Include Entity with Namespace'; $lang['en_US']['i18nTestModule.ss']['LAYOUTTEMPLATENONAMESPACE'] = 'Layout Template no namespace'; $lang['en_US']['i18nTestModule.ss']['SPRINTFNONAMESPACE'] = 'My replacement no namespace: %s'; $lang['en_US']['i18nTestModuleInclude.ss']['NONAMESPACE'] = 'Include Entity without Namespace'; $lang['en_US']['i18nTestModuleInclude.ss']['SPRINTFINCLUDENAMESPACE'] = 'My include replacement: %s'; $lang['en_US']['i18nTestModuleInclude.ss']['SPRINTFINCLUDENONAMESPACE'] = 'My include replacement no namespace: %s'; ?>,)
Line 1733 of Assert.php
* PHPUnit_Framework_Assert::assertThat(<?php global $lang; $lang['en_US']['i18nTestModule']['ADDITION'] = 'Addition'; $lang['en_US']['i18nTestModule']['ENTITY'] = array( 'Entity with "Double Quotes"', PR_LOW, 'Comment for entity' ); $lang['en_US']['i18nTestModule']['LAYOUTTEMPLATE'] = 'Layout Template'; $lang['en_US']['i18nTestModule']['OTHERENTITY'] = 'Other Entity'; $lang['en_US']['i18nTestModule']['PLURALNAME'] = array( 'I18n Test Moduls', 50, 'Pural name of the object, used in dropdowns and to generally identify a collection of this object in the interface' ); $lang['en_US']['i18nTestModule']['SINGULARNAME'] = array( 'I18n Test Module', 50, 'Singular name of the object, used in dropdowns and to generally identify a single object in the interface' ); $lang['en_US']['i18nTestModule']['SPRINTFNAMESPACE'] = 'My replacement: %s'; $lang['en_US']['i18nTestModule']['WITHNAMESPACE'] = 'Include Entity with Namespace'; $lang['en_US']['i18nTestModule.ss']['LAYOUTTEMPLATENONAMESPACE'] = 'Layout Template no namespace'; $lang['en_US']['i18nTestModule.ss']['SPRINTFNONAMESPACE'] = 'My replacement no namespace: %s'; $lang['en_US']['i18nTestModuleInclude.ss']['NONAMESPACE'] = 'Include Entity without Namespace'; $lang['en_US']['i18nTestModuleInclude.ss']['SPRINTFINCLUDENAMESPACE'] = 'My include replacement: %s'; $lang['en_US']['i18nTestModuleInclude.ss']['SPRINTFINCLUDENONAMESPACE'] = 'My include replacement no namespace: %s'; ?>,PHPUnit_Framework_Constraint_StringContains,)
Line 148 of Assert.php
* PHPUnit_Framework_Assert::assertContains($lang['en_US']['i18nTestModule']['MAINTEMPLATE'] = 'Main Template';,<?php global $lang; $lang['en_US']['i18nTestModule']['ADDITION'] = 'Addition'; $lang['en_US']['i18nTestModule']['ENTITY'] = array( 'Entity with "Double Quotes"', PR_LOW, 'Comment for entity' ); $lang['en_US']['i18nTestModule']['LAYOUTTEMPLATE'] = 'Layout Template'; $lang['en_US']['i18nTestModule']['OTHERENTITY'] = 'Other Entity'; $lang['en_US']['i18nTestModule']['PLURALNAME'] = array( 'I18n Test Moduls', 50, 'Pural name of the object, used in dropdowns and to generally identify a collection of this object in the interface' ); $lang['en_US']['i18nTestModule']['SINGULARNAME'] = array( 'I18n Test Module', 50, 'Singular name of the object, used in dropdowns and to generally identify a single object in the interface' ); $lang['en_US']['i18nTestModule']['SPRINTFNAMESPACE'] = 'My replacement: %s'; $lang['en_US']['i18nTestModule']['WITHNAMESPACE'] = 'Include Entity with Namespace'; $lang['en_US']['i18nTestModule.ss']['LAYOUTTEMPLATENONAMESPACE'] = 'Layout Template no namespace'; $lang['en_US']['i18nTestModule.ss']['SPRINTFNONAMESPACE'] = 'My replacement no namespace: %s'; $lang['en_US']['i18nTestModuleInclude.ss']['NONAMESPACE'] = 'Include Entity without Namespace'; $lang['en_US']['i18nTestModuleInclude.ss']['SPRINTFINCLUDENAMESPACE'] = 'My include replacement: %s'; $lang['en_US']['i18nTestModuleInclude.ss']['SPRINTFINCLUDENONAMESPACE'] = 'My include replacement no namespace: %s'; ?>)
Line 412 of i18nTextCollectorTest.php
* i18nTextCollectorTest->testCollectFromFilesystemAndWriteMasterTables()
* ReflectionMethod->invokeArgs(i18nTextCollectorTest,Array)
Line 822 of TestCase.php
* PHPUnit_Framework_TestCase->runTest()
Line 705 of TestCase.php
* PHPUnit_Framework_TestCase->runBare()
Line 686 of TestResult.php
* PHPUnit_Framework_TestResult->run(i18nTextCollectorTest)
Line 652 of TestCase.php
* PHPUnit_Framework_TestCase->run(PHPUnit_Framework_TestResult)
Line 756 of TestSuite.php
* PHPUnit_Framework_TestSuite->runTest(i18nTextCollectorTest,PHPUnit_Framework_TestResult)
Line 731 of TestSuite.php
* PHPUnit_Framework_TestSuite->run(PHPUnit_Framework_TestResult,,Array,Array,)
Line 674 of TestSuite.php
* PHPUnit_Framework_TestSuite->run(PHPUnit_Framework_TestResult)
Line 182 of TestRunner.php
* TestRunner->runTests(Array)
Line 129 of TestRunner.php
* TestRunner->only(HTTPRequest)
Line 129 of RequestHandler.php
* RequestHandler->handleRequest(HTTPRequest)
Line 119 of Controller.php
* Controller->handleRequest(HTTPRequest)
Line 143 of RequestHandler.php
* RequestHandler->handleRequest(HTTPRequest)
Line 119 of Controller.php
* Controller->handleRequest(HTTPRequest)
Line 277 of Director.php
* Director::handleRequest(HTTPRequest,Session)
Line 121 of Director.php
* Director::direct(/dev/tests/i18nTextCollectorTest)
Line 118 of main.php

9 tests run: 8 passes, 1 fails, and 0 exceptions

Greetings and a nice weekend, carsten.