Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
matejkrenek committed Dec 24, 2022
1 parent b89dd2e commit aaf8bf0
Show file tree
Hide file tree
Showing 6 changed files with 83 additions and 9 deletions.
1 change: 1 addition & 0 deletions .phpunit.result.cache
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"version":1,"defects":[],"times":{"Bengr\\Admin\\Tests\\Unit\\ExampleTest::test_that_true_is_true":5.077}}
6 changes: 4 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
],
"autoload": {
"psr-4": {
"Bengr\\Admin\\": "src/"
"Bengr\\Admin\\": "src/",
"Bengr\\Admin\\Tests\\": "tests/"
}
},
"extra": {
Expand All @@ -27,7 +28,8 @@
"minimum-stability": "dev",
"prefer-stable": true,
"require-dev": {
"orchestra/testbench": "^7.13"
"orchestra/testbench": "^7.13",
"phpunit/phpunit": "^9.5"
},
"require": {
"spatie/laravel-package-tools": "^1.13"
Expand Down
14 changes: 7 additions & 7 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

33 changes: 33 additions & 0 deletions phpunit.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
bootstrap="vendor/autoload.php"
backupGlobals="false"
backupStaticAttributes="false"
colors="true"
verbose="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd"
>
<coverage>
<include>
<directory suffix=".php">src/</directory>
</include>
</coverage>
<testsuites>
<testsuite name="Unit">
<directory suffix="Test.php">./tests/Unit</directory>
</testsuite>
<testsuite name="Feature">
<directory suffix="Test.php">./tests/Feature</directory>
</testsuite>
</testsuites>
<php>
<env name="DB_CONNECTION" value="testing"/>
<env name="APP_KEY" value="base64:2fl+Ktvkfl+Fuz4Qp/A75G2RTiWVA/ZoKZvp6fiiM10="/>
</php>
</phpunit>
25 changes: 25 additions & 0 deletions tests/TestCase.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?php

namespace Bengr\Admin\Tests;

use Bengr\Admin\AdminServiceProvider;

class TestCase extends \Orchestra\Testbench\TestCase
{
public function setUp(): void
{
parent::setUp();
}

protected function getPackageProviders($app)
{
return [
AdminServiceProvider::class,
];
}

protected function getEnvironmentSetUp($app)
{
// perform environment setup
}
}
13 changes: 13 additions & 0 deletions tests/Unit/ExampleTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php

namespace Bengr\Admin\Tests\Unit;

use Bengr\Admin\Tests\TestCase;

class ExampleTest extends TestCase
{
public function test_that_true_is_true()
{
$this->assertTrue(true);
}
}

0 comments on commit aaf8bf0

Please sign in to comment.