コード例 #1
0
 function testCollectFromEntityProvidersInCustomObject()
 {
     $c = new i18nTextCollector();
     $filePath = Director::baseFolder() . '/sapphire/tests/i18n/i18nTextCollectorTestMyObject.php';
     $matches = $c->collectFromEntityProviders($filePath);
     $this->assertEquals(array_keys($matches), array('i18nTextCollectorTestMyObject.PLURALNAME', 'i18nTextCollectorTestMyObject.SINGULARNAME'));
     $this->assertEquals('My Object', $matches['i18nTextCollectorTestMyObject.SINGULARNAME'][0]);
 }
コード例 #2
0
	function testCollectFromEntityProvidersInCustomObject() {
		$c = new i18nTextCollector();

		$filePath = $this->getCurrentAbsolutePath() . '/i18nTextCollectorTestMyObject.php';
		$matches = $c->collectFromEntityProviders($filePath);
		$this->assertEquals(
			array_keys($matches),
			array(
				'i18nTextCollectorTestMyObject.PLURALNAME',
				'i18nTextCollectorTestMyObject.SINGULARNAME',
			)
		);
		$this->assertEquals(
			'My Object',
			$matches['i18nTextCollectorTestMyObject.SINGULARNAME'][0]
		);
	}