Skip to content

Commit

Permalink
refactor: Move tests to Test\ namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasdotvin committed Apr 7, 2023
1 parent 5801509 commit b1ecf10
Show file tree
Hide file tree
Showing 20 changed files with 57 additions and 74 deletions.
1 change: 1 addition & 0 deletions .phpunit.cache/test-results

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
},
"autoload-dev": {
"psr-4": {
"LucasDotVin\\Soulbscription\\Tests\\": "tests"
"Tests\\": "tests"
}
},
"scripts": {
Expand Down
56 changes: 19 additions & 37 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,39 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
backupGlobals="false"
backupStaticAttributes="false"
bootstrap="vendor/autoload.php"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false"
executionOrder="random"
failOnWarning="true"
failOnRisky="true"
failOnEmptyTestSuite="true"
beStrictAboutOutputDuringTests="true"
verbose="true"
>
<testsuites>
<testsuite name="LucasDotVin Test Suite">
<directory>tests</directory>
</testsuite>
</testsuites>
<coverage>
<include>
<directory suffix=".php">./src</directory>
</include>
<report>
<html outputDirectory="build/coverage"/>
<text outputFile="build/coverage.txt"/>
<clover outputFile="build/logs/clover.xml"/>
</report>
</coverage>
<logging>
<junit outputFile="build/report.junit.xml"/>
</logging>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.0/phpunit.xsd" backupGlobals="false" bootstrap="vendor/autoload.php" colors="true" processIsolation="false" stopOnFailure="false" executionOrder="random" failOnWarning="true" failOnRisky="true" failOnEmptyTestSuite="true" beStrictAboutOutputDuringTests="true" cacheDirectory=".phpunit.cache" backupStaticProperties="false">
<testsuites>
<testsuite name="LucasDotVin Test Suite">
<directory>tests</directory>
</testsuite>
</testsuites>
<coverage>
<include>
<directory suffix=".php">./src</directory>
</include>
<report>
<html outputDirectory="build/coverage"/>
<text outputFile="build/coverage.txt"/>
<clover outputFile="build/logs/clover.xml"/>
</report>
</coverage>
<logging>
<junit outputFile="build/report.junit.xml"/>
</logging>
</phpunit>
4 changes: 2 additions & 2 deletions tests/Mocks/Database/Factories/UserFactory.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php

namespace LucasDotVin\Soulbscription\Tests\Mocks\Database\Factories;
namespace Tests\Mocks\Database\Factories;

use LucasDotVin\Soulbscription\Tests\Mocks\Models\User;
use Tests\Mocks\Models\User;
use Orchestra\Testbench\Factories\UserFactory as OrchestraUserFactory;

class UserFactory extends OrchestraUserFactory
Expand Down
4 changes: 2 additions & 2 deletions tests/Mocks/Models/User.php
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<?php

namespace LucasDotVin\Soulbscription\Tests\Mocks\Models;
namespace Tests\Mocks\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Notifications\Notifiable;
use LucasDotVin\Soulbscription\Models\Concerns\HasSubscriptions;
use LucasDotVin\Soulbscription\Tests\Mocks\Database\Factories\UserFactory;
use Tests\Mocks\Database\Factories\UserFactory;

class User extends Authenticatable
{
Expand Down
4 changes: 2 additions & 2 deletions tests/Models/Concerns/ExpiresAndHasGraceDaysTest.php
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<?php

namespace LucasDotVin\Soulbscription\Tests\Feature\Models\Concerns;
namespace Tests\Feature\Models\Concerns;

use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Foundation\Testing\WithFaker;
use LucasDotVin\Soulbscription\Models\Concerns\ExpiresAndHasGraceDays;
use LucasDotVin\Soulbscription\Models\Scopes\ExpiringWithGraceDaysScope;
use LucasDotVin\Soulbscription\Models\Subscription;
use LucasDotVin\Soulbscription\Tests\TestCase;
use Tests\TestCase;

class ExpiresAndHasGraceDaysTest extends TestCase
{
Expand Down
4 changes: 2 additions & 2 deletions tests/Models/Concerns/ExpiresTest.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<?php

namespace LucasDotVin\Soulbscription\Tests\Feature\Models\Concerns;
namespace Tests\Feature\Models\Concerns;

use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Foundation\Testing\WithFaker;
use LucasDotVin\Soulbscription\Models\FeatureConsumption;
use LucasDotVin\Soulbscription\Tests\TestCase;
use Tests\TestCase;

class ExpiresTest extends TestCase
{
Expand Down
4 changes: 2 additions & 2 deletions tests/Models/Concerns/HandlesRecurrenceTest.php
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<?php

namespace LucasDotVin\Soulbscription\Tests\Feature\Models\Concerns;
namespace Tests\Feature\Models\Concerns;

use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Foundation\Testing\WithFaker;
use Illuminate\Support\Carbon;
use LucasDotVin\Soulbscription\Enums\PeriodicityType;
use LucasDotVin\Soulbscription\Models\Plan;
use LucasDotVin\Soulbscription\Tests\TestCase;
use Tests\TestCase;

class HandlesRecurrenceTest extends TestCase
{
Expand Down
6 changes: 3 additions & 3 deletions tests/Models/Concerns/HasSubscriptionsTest.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace LucasDotVin\Soulbscription\Tests\Feature\Models\Concerns;
namespace Tests\Feature\Models\Concerns;

use Illuminate\Database\Eloquent\ModelNotFoundException;
use Illuminate\Foundation\Testing\RefreshDatabase;
Expand All @@ -19,8 +19,8 @@
use LucasDotVin\Soulbscription\Models\Plan;
use LucasDotVin\Soulbscription\Models\Subscription;
use LucasDotVin\Soulbscription\Models\SubscriptionRenewal;
use LucasDotVin\Soulbscription\Tests\Mocks\Models\User;
use LucasDotVin\Soulbscription\Tests\TestCase;
use Tests\Mocks\Models\User;
use Tests\TestCase;
use OutOfBoundsException;
use OverflowException;

Expand Down
4 changes: 2 additions & 2 deletions tests/Models/Concerns/StartsTest.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<?php

namespace LucasDotVin\Soulbscription\Tests\Feature\Models\Concerns;
namespace Tests\Feature\Models\Concerns;

use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Foundation\Testing\WithFaker;
use LucasDotVin\Soulbscription\Models\Subscription;
use LucasDotVin\Soulbscription\Tests\TestCase;
use Tests\TestCase;

class StartsTest extends TestCase
{
Expand Down
6 changes: 3 additions & 3 deletions tests/Models/Concerns/SuppressesTest.php
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<?php

namespace LucasDotVin\Soulbscription\Tests\Feature\Models\Concerns;
namespace Tests\Feature\Models\Concerns;

use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Foundation\Testing\WithFaker;
use LucasDotVin\Soulbscription\Models\Subscription;
use LucasDotVin\Soulbscription\Tests\TestCase;
use Tests\TestCase;

class SuppresssTest extends TestCase
class SuppressesTest extends TestCase
{
use RefreshDatabase;
use WithFaker;
Expand Down
4 changes: 2 additions & 2 deletions tests/Models/FeaturePlanTest.php
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<?php

namespace LucasDotVin\Soulbscription\Tests\Feature\Models;
namespace Tests\Feature\Models;

use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Foundation\Testing\WithFaker;
use LucasDotVin\Soulbscription\Models\Feature;
use LucasDotVin\Soulbscription\Models\FeaturePlan;
use LucasDotVin\Soulbscription\Models\Plan;
use LucasDotVin\Soulbscription\Tests\TestCase;
use Tests\TestCase;

class FeaturePlanTest extends TestCase
{
Expand Down
4 changes: 2 additions & 2 deletions tests/Models/FeatureTest.php
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<?php

namespace LucasDotVin\Soulbscription\Tests\Feature\Models;
namespace Tests\Feature\Models;

use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Foundation\Testing\WithFaker;
use Illuminate\Support\Carbon;
use LucasDotVin\Soulbscription\Enums\PeriodicityType;
use LucasDotVin\Soulbscription\Models\Feature;
use LucasDotVin\Soulbscription\Tests\TestCase;
use Tests\TestCase;

class FeatureTest extends TestCase
{
Expand Down
4 changes: 2 additions & 2 deletions tests/Models/PlanTest.php
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<?php

namespace LucasDotVin\Soulbscription\Tests\Feature\Models;
namespace Tests\Feature\Models;

use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Foundation\Testing\WithFaker;
use Illuminate\Support\Carbon;
use LucasDotVin\Soulbscription\Enums\PeriodicityType;
use LucasDotVin\Soulbscription\Models\Plan;
use LucasDotVin\Soulbscription\Models\Subscription;
use LucasDotVin\Soulbscription\Tests\TestCase;
use Tests\TestCase;

class PlanTest extends TestCase
{
Expand Down
6 changes: 3 additions & 3 deletions tests/Models/SubscriptionTest.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace LucasDotVin\Soulbscription\Tests\Feature\Models;
namespace Tests\Feature\Models;

use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Foundation\Testing\WithFaker;
Expand All @@ -12,8 +12,8 @@
use LucasDotVin\Soulbscription\Events\SubscriptionSuppressed;
use LucasDotVin\Soulbscription\Models\Plan;
use LucasDotVin\Soulbscription\Models\Subscription;
use LucasDotVin\Soulbscription\Tests\Mocks\Models\User;
use LucasDotVin\Soulbscription\Tests\TestCase;
use Tests\Mocks\Models\User;
use Tests\TestCase;

class SubscriptionTest extends TestCase
{
Expand Down
4 changes: 2 additions & 2 deletions tests/Scopes/ExpiringScopeTest.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<?php

namespace LucasDotVin\Soulbscription\Tests\Feature\Models;
namespace Tests\Feature\Models;

use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Foundation\Testing\WithFaker;
use LucasDotVin\Soulbscription\Models\FeatureConsumption;
use LucasDotVin\Soulbscription\Tests\TestCase;
use Tests\TestCase;

class ExpiringScopeTest extends TestCase
{
Expand Down
4 changes: 2 additions & 2 deletions tests/Scopes/ExpiringWithGraceDaysScopeTest.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<?php

namespace LucasDotVin\Soulbscription\Tests\Feature\Models;
namespace Tests\Feature\Models;

use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Foundation\Testing\WithFaker;
use LucasDotVin\Soulbscription\Models\Subscription;
use LucasDotVin\Soulbscription\Tests\TestCase;
use Tests\TestCase;

class ExpiringWithGraceDaysScopeTest extends TestCase
{
Expand Down
4 changes: 2 additions & 2 deletions tests/Scopes/StartingScopeTest.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<?php

namespace LucasDotVin\Soulbscription\Tests\Feature\Models;
namespace Tests\Feature\Models;

use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Foundation\Testing\WithFaker;
use LucasDotVin\Soulbscription\Models\Subscription;
use LucasDotVin\Soulbscription\Tests\TestCase;
use Tests\TestCase;

class StartingScopeTest extends TestCase
{
Expand Down
4 changes: 2 additions & 2 deletions tests/Scopes/SuppressingScopeTest.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<?php

namespace LucasDotVin\Soulbscription\Tests\Feature\Models;
namespace Tests\Feature\Models;

use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Foundation\Testing\WithFaker;
use LucasDotVin\Soulbscription\Models\Subscription;
use LucasDotVin\Soulbscription\Tests\TestCase;
use Tests\TestCase;

class SuppressingScopeTest extends TestCase
{
Expand Down
2 changes: 1 addition & 1 deletion tests/TestCase.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace LucasDotVin\Soulbscription\Tests;
namespace Tests;

use Illuminate\Database\Eloquent\Factories\Factory;
use LucasDotVin\Soulbscription\SoulbscriptionServiceProvider;
Expand Down

0 comments on commit b1ecf10

Please sign in to comment.