File modules/util/test/TextMessageTest.class.php
Last commit: Thu Nov 19 21:42:39 2020 +0100 Jan Dankert Fix: Variables with key '0' are now resolved.
1 <?php 2 3 namespace util\test; 4 5 use util\text\TextMessage; 6 use util\YAML; 7 8 class TextMessageTest extends TestCase { 9 10 public function testMessage() 11 { 12 $abc = TextMessage::create('abc ${text}',['text'=>'def']); 13 14 $this->assertEquals('abc \'def\'',$abc); 15 } 16 17 public function testMessageNumberedIndex() 18 { 19 $abc = TextMessage::create('abc ${0}',['def']); 20 21 $this->assertEquals('abc \'def\'',$abc); 22 } 23 24 public function testSanitizer() 25 { 26 $abc = TextMessage::create('abc ${0}',['def/']); 27 28 $this->assertEquals('abc \'def\'(!)',$abc); 29 } 30 } 31 32 33
Downloadmodules/util/test/TextMessageTest.class.php
History Thu, 19 Nov 2020 21:42:39 +0100 Jan Dankert Fix: Variables with key '0' are now resolved.