php artisan migrate:fresh
npm clean-install
npm run production
-nice php artisan test --without-tty --coverage-html /var/www/coverage/alttp/php
+XDEBUG_MODE=coverage nice php artisan test --without-tty --coverage-html /var/www/coverage/alttp/php
nice npm run test -- --coverage --coverageDirectory /var/www/coverage/alttp/js --coverageReporters html --collectCoverageFrom 'resources/js/**'
+++ /dev/null
-<?php
-
-namespace Tests\Unit;
-
-use PHPUnit\Framework\TestCase;
-
-class ExampleTest extends TestCase
-{
- /**
- * A basic test example.
- *
- * @return void
- */
- public function test_that_true_is_true()
- {
- $this->assertTrue(true);
- }
-}
--- /dev/null
+<?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(''));
+ }
+
+}