diff --git a/tests/CreatesApplication.php b/tests/CreatesApplication.php new file mode 100644 index 0000000000..8d8a77e99d --- /dev/null +++ b/tests/CreatesApplication.php @@ -0,0 +1,22 @@ +make(Kernel::class)->bootstrap(); + + return $app; + } +} \ No newline at end of file diff --git a/tests/Feature/ExampleTest.php b/tests/Feature/ExampleTest.php new file mode 100644 index 0000000000..c23bfc63d5 --- /dev/null +++ b/tests/Feature/ExampleTest.php @@ -0,0 +1,23 @@ +get('/'); + + $response->assertStatus(200); + } +} \ No newline at end of file diff --git a/tests/TestCase.php b/tests/TestCase.php index c2a57c8e43..03cde96b56 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -1,153 +1,15 @@ id)->where('name', 'viewRange')->delete(); - Preference::create( - [ - 'user_id' => $user->id, - 'name' => 'viewRange', - 'data' => $range, - ] - ); - // set period to match? - - } - if ($range === 'custom') { - $this->session( - [ - 'start' => Carbon::now()->subDays(20), - 'end' => Carbon::now(), - ] - ); - } - } - - /** - * Creates the application. - * - * @return \Illuminate\Foundation\Application - */ - public function createApplication() - { - $app = require __DIR__ . '/../bootstrap/app.php'; - - $app->make(Illuminate\Contracts\Console\Kernel::class)->bootstrap(); - - return $app; - } - - /** - * @return array - */ - public function dateRangeProvider() - { - return [ - 'one day' => ['1D'], - 'one week' => ['1W'], - 'one month' => ['1M'], - 'three months' => ['3M'], - 'six months' => ['6M'], - 'one year' => ['1Y'], - 'custom range' => ['custom'], - ]; - } - - /** - * @return User - */ - public function emptyUser() - { - $user = User::find(2); - - return $user; - } - - /** - * @return array - */ - public function naughtyStringProvider() - { - /* - * If on Travis, return very small set. - */ - if (getenv('TRAVIS') == 'true') { - return [['Default value']]; - - } - $path = realpath(__DIR__ . '/../resources/tests/blns.base64.json'); - $content = file_get_contents($path); - $array = json_decode($content); - $return = []; - foreach ($array as $entry) { - $return[] = [base64_decode($entry)]; - } - - return $return; - } - - /** - * Sets up the fixture, for example, opens a network connection. - * This method is called before a test is executed. - */ - public function setUp() - { - parent::setUp(); - - } - - /** - * @return User - */ - public function user() - { - $user = User::find(1); - - return $user; - } - - /** - * @param string $class - * - * @return \Mockery\MockInterface - */ - protected function mock($class) - { - Log::debug(sprintf('Will now mock %s', $class)); - $object = Mockery::mock($class); - $this->app->instance($class, $object); - - return $object; - } -} + use CreatesApplication; +} \ No newline at end of file diff --git a/tests/Unit/ExampleTest.php b/tests/Unit/ExampleTest.php new file mode 100644 index 0000000000..239346394a --- /dev/null +++ b/tests/Unit/ExampleTest.php @@ -0,0 +1,20 @@ +assertTrue(true); + } +} \ No newline at end of file