Common = new CommonHelper($View); Router::scope('/', function(RouteBuilder $routes) { $routes->fallbacks(DashedRoute::class); }); } /** * CommonHelperTest::testMetaRobots() * * @return void */ public function testMetaRobots() { $result = $this->Common->metaRobots(); $this->assertStringContainsString(''; $this->assertEquals($expected, $result); } /** * CommonHelperTest::testMetaDescription() * * @return void */ public function testMetaDescription() { $result = $this->Common->metaDescription('foo', 'deu'); $expected = ''; $this->assertEquals($expected, $result); } /** * CommonHelperTest::testMetaKeywords() * * @return void */ public function testMetaKeywords() { $result = $this->Common->metaKeywords('foo bar', 'deu'); $expected = ''; $this->assertEquals($expected, $result); } /** * CommonHelperTest::testMetaRss() * * @return void */ public function testMetaRss() { $result = $this->Common->metaRss('/some/url', 'some title'); $expected = ''; $this->assertEquals($expected, $result); } /** * CommonHelperTest::testMetaEquiv() * * @return void */ public function testMetaEquiv() { $result = $this->Common->metaEquiv('type', 'value'); $expected = ''; $this->assertEquals($expected, $result); } /** * @return void */ public function testMetaCanonical() { $is = $this->Common->metaCanonical('/some/url/param1'); $this->assertEquals('', trim($is)); $is = $this->Common->metaCanonical('/some/url/param1', true); $this->assertEquals('', trim($is)); } /** * @return void */ public function testMetaAlternate() { $is = $this->Common->metaAlternate('/some/url/param1', 'de-de', true); $this->assertEquals('', trim($is)); $is = $this->Common->metaAlternate(['controller' => 'Some', 'action' => 'url'], 'de', true); $this->assertEquals('', trim($is)); $is = $this->Common->metaAlternate(['controller' => 'Some', 'action' => 'url'], ['de', 'de-ch'], true); $this->assertEquals('' . PHP_EOL . '', trim($is)); $is = $this->Common->metaAlternate(['controller' => 'Some', 'action' => 'url'], ['de' => ['ch', 'at'], 'en' => ['gb', 'us']], true); $this->assertEquals('' . PHP_EOL . '' . PHP_EOL . '' . PHP_EOL . '', trim($is)); } /** * @return void */ public function testAsp() { $res = $this->Common->asp('House', 2, true); $expected = __d('tools', 'Houses'); $this->assertEquals($expected, $res); $res = $this->Common->asp('House', 1, true); $expected = __d('tools', 'House'); $this->assertEquals($expected, $res); } /** * @return void */ public function testSp() { $res = $this->Common->sp('House', 'Houses', 0, true); $expected = __d('tools', 'Houses'); $this->assertEquals($expected, $res); $res = $this->Common->sp('House', 'Houses', 2, true); $this->assertEquals($expected, $res); $res = $this->Common->sp('House', 'Houses', 1, true); $expected = __d('tools', 'House'); $this->assertEquals($expected, $res); $res = $this->Common->sp('House', 'Houses', 1); $expected = 'House'; $this->assertEquals($expected, $res); } /** * TearDown method * * @return void */ public function tearDown(): void { parent::tearDown(); unset($this->Common); } }