Ejemplo n.º 1
0
 public function testImportMessages()
 {
     Message::importMessages(['Hello World!', 'Hello Piñata!']);
     $this->assertNotNull(Message::whereCode('hello.world')->first());
     $this->assertNotNull(Message::whereCode('hello.piñata')->first());
     Message::truncate();
 }
Ejemplo n.º 2
0
 public function onScanMessages()
 {
     if (post('purge_messages', false)) {
         Message::truncate();
     }
     ThemeScanner::scan();
     Flash::success(Lang::get('rainlab.translate::lang.messages.scan_messages_success'));
     return $this->onRefresh();
 }
Ejemplo n.º 3
0
 public function testImportMessagesCopiesFromDeprecated()
 {
     $this->seedDeprecatedData();
     Message::importMessages(['Hello World!', 'Hello Piñata!']);
     $newMessage = Message::whereCode('hello.piñata')->first();
     $deprecatedMessage = Message::whereCode('hello.pinata')->first();
     $this->assertNotNull($newMessage);
     $this->assertEquals($newMessage->messageData, $deprecatedMessage->messageData);
     Message::truncate();
 }