Jump to:

23486 Posts in 18995 Topics by 2878 members

General Questions

SilverStripe Forums » General Questions » i18n unit test

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

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

Page: 1
Go to End
Author Topic: 1320 Views
  • dacar
    Avatar
    Community Member
    168 Posts

    i18n unit test Link to this post

    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.

    1320 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.