summaryrefslogtreecommitdiff
path: root/site/tests
diff options
context:
space:
mode:
authorhorus_arch2018-02-07 18:07:53 +0100
committerhorus_arch2018-02-07 18:07:53 +0100
commit92eb8143762e116e8959f6270271fd5540ca50ac (patch)
treea9fdc5009b9816fb448431b24bac38f7a215d40d /site/tests
parent71950479fbd6088f249e5fda3b180f294d1d745d (diff)
downloadalkobote-92eb8143762e116e8959f6270271fd5540ca50ac.tar.gz
Adds basic site in laravel.
Diffstat (limited to 'site/tests')
-rw-r--r--site/tests/CreatesApplication.php25
-rw-r--r--site/tests/Feature/ExampleTest.php21
-rw-r--r--site/tests/TestCase.php10
-rw-r--r--site/tests/Unit/ExampleTest.php19
4 files changed, 75 insertions, 0 deletions
diff --git a/site/tests/CreatesApplication.php b/site/tests/CreatesApplication.php
new file mode 100644
index 0000000..ff133fb
--- /dev/null
+++ b/site/tests/CreatesApplication.php
@@ -0,0 +1,25 @@
+<?php
+
+namespace Tests;
+
+use Illuminate\Support\Facades\Hash;
+use Illuminate\Contracts\Console\Kernel;
+
+trait CreatesApplication
+{
+ /**
+ * Creates the application.
+ *
+ * @return \Illuminate\Foundation\Application
+ */
+ public function createApplication()
+ {
+ $app = require __DIR__.'/../bootstrap/app.php';
+
+ $app->make(Kernel::class)->bootstrap();
+
+ Hash::driver('bcrypt')->setRounds(4);
+
+ return $app;
+ }
+}
diff --git a/site/tests/Feature/ExampleTest.php b/site/tests/Feature/ExampleTest.php
new file mode 100644
index 0000000..f31e495
--- /dev/null
+++ b/site/tests/Feature/ExampleTest.php
@@ -0,0 +1,21 @@
+<?php
+
+namespace Tests\Feature;
+
+use Tests\TestCase;
+use Illuminate\Foundation\Testing\RefreshDatabase;
+
+class ExampleTest extends TestCase
+{
+ /**
+ * A basic test example.
+ *
+ * @return void
+ */
+ public function testBasicTest()
+ {
+ $response = $this->get('/');
+
+ $response->assertStatus(200);
+ }
+}
diff --git a/site/tests/TestCase.php b/site/tests/TestCase.php
new file mode 100644
index 0000000..2932d4a
--- /dev/null
+++ b/site/tests/TestCase.php
@@ -0,0 +1,10 @@
+<?php
+
+namespace Tests;
+
+use Illuminate\Foundation\Testing\TestCase as BaseTestCase;
+
+abstract class TestCase extends BaseTestCase
+{
+ use CreatesApplication;
+}
diff --git a/site/tests/Unit/ExampleTest.php b/site/tests/Unit/ExampleTest.php
new file mode 100644
index 0000000..e9fe19c
--- /dev/null
+++ b/site/tests/Unit/ExampleTest.php
@@ -0,0 +1,19 @@
+<?php
+
+namespace Tests\Unit;
+
+use Tests\TestCase;
+use Illuminate\Foundation\Testing\RefreshDatabase;
+
+class ExampleTest extends TestCase
+{
+ /**
+ * A basic test example.
+ *
+ * @return void
+ */
+ public function testBasicTest()
+ {
+ $this->assertTrue(true);
+ }
+}