]> git.localhorst.tv Git - alttp.git/blobdiff - tests/Unit/Models/ChatLogTest.php
add simple unit test
[alttp.git] / tests / Unit / Models / ChatLogTest.php
diff --git a/tests/Unit/Models/ChatLogTest.php b/tests/Unit/Models/ChatLogTest.php
new file mode 100644 (file)
index 0000000..72fd172
--- /dev/null
@@ -0,0 +1,37 @@
+<?php
+
+namespace Tests\Unit\Models;
+
+use App\Models\ChatLog;
+use PHPUnit\Framework\TestCase;
+
+class ChatLogTest extends TestCase {
+
+       public function test_classification() {
+               $this->assertEquals('gg', ChatLog::classify('gg'));
+               $this->assertEquals('gg', ChatLog::classify('GG'));
+               $this->assertEquals('gg', ChatLog::classify('Gg'));
+
+               $this->assertEquals('gl', ChatLog::classify('glhf'));
+               $this->assertEquals('gl', ChatLog::classify('gl & hf'));
+
+               $this->assertEquals('hi', ChatLog::classify('hi'));
+               $this->assertEquals('hi', ChatLog::classify('hallo'));
+
+               $this->assertEquals('hype', ChatLog::classify('122 Hype!'));
+
+               $this->assertEquals('number', ChatLog::classify('13'));
+               $this->assertEquals('number', ChatLog::classify('22'));
+
+               $this->assertEquals('lol', ChatLog::classify('haha'));
+               $this->assertEquals('lol', ChatLog::classify('KEKW'));
+               $this->assertEquals('lol', ChatLog::classify('LUL'));
+
+               $this->assertEquals('o7', ChatLog::classify('o7'));
+
+               $this->assertEquals('pog', ChatLog::classify('Pog'));
+
+               $this->assertEquals('unclassified', ChatLog::classify(''));
+       }
+
+}