mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-01-12 09:02:06 -06:00
Clean up test code, prep for merge.
This commit is contained in:
parent
0264184442
commit
cd19e86141
@ -1,63 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
|
|
||||||
<!--
|
|
||||||
~ phpunit.coverage.specific.xml
|
|
||||||
~ Copyright (c) 2020 james@firefly-iii.org
|
|
||||||
~
|
|
||||||
~ This file is part of Firefly III (https://github.com/firefly-iii).
|
|
||||||
~
|
|
||||||
~ This program is free software: you can redistribute it and/or modify
|
|
||||||
~ it under the terms of the GNU Affero General Public License as
|
|
||||||
~ published by the Free Software Foundation, either version 3 of the
|
|
||||||
~ License, or (at your option) any later version.
|
|
||||||
~
|
|
||||||
~ This program is distributed in the hope that it will be useful,
|
|
||||||
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
~ GNU Affero General Public License for more details.
|
|
||||||
~
|
|
||||||
~ You should have received a copy of the GNU Affero General Public License
|
|
||||||
~ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
||||||
-->
|
|
||||||
|
|
||||||
<phpunit backupGlobals="false"
|
|
||||||
backupStaticAttributes="false"
|
|
||||||
bootstrap="vendor/autoload.php"
|
|
||||||
colors="true"
|
|
||||||
convertErrorsToExceptions="true"
|
|
||||||
convertNoticesToExceptions="true"
|
|
||||||
convertWarningsToExceptions="true"
|
|
||||||
processIsolation="false"
|
|
||||||
stopOnFailure="true">
|
|
||||||
<listeners>
|
|
||||||
<listener class="JohnKary\PHPUnit\Listener\SpeedTrapListener" />
|
|
||||||
</listeners>
|
|
||||||
<testsuites>
|
|
||||||
<testsuite name="Api">
|
|
||||||
<directory suffix="Test.php">./tests/Api</directory>
|
|
||||||
</testsuite>
|
|
||||||
<testsuite name="Unit">
|
|
||||||
<directory suffix="Test.php">./tests/Unit</directory>
|
|
||||||
</testsuite>
|
|
||||||
<testsuite name="Feature">
|
|
||||||
<directory suffix="Test.php">./tests/Feature</directory>
|
|
||||||
</testsuite>
|
|
||||||
</testsuites>
|
|
||||||
<filter>
|
|
||||||
<whitelist processUncoveredFilesFromWhitelist="true">
|
|
||||||
<directory suffix=".php">./app</directory>
|
|
||||||
<exclude>
|
|
||||||
<file>app/Http/breadcrumbs.php</file>
|
|
||||||
</exclude>
|
|
||||||
</whitelist>
|
|
||||||
</filter>
|
|
||||||
<logging>
|
|
||||||
<log type="coverage-clover" target="./storage/build/clover-specific.xml" />
|
|
||||||
</logging>
|
|
||||||
<php>
|
|
||||||
<env name="APP_ENV" value="testing"/>
|
|
||||||
<env name="CACHE_DRIVER" value="array"/>
|
|
||||||
<env name="SESSION_DRIVER" value="array"/>
|
|
||||||
<env name="QUEUE_DRIVER" value="sync"/>
|
|
||||||
</php>
|
|
||||||
</phpunit>
|
|
@ -1,64 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
|
|
||||||
|
|
||||||
<!--
|
|
||||||
~ phpunit.coverage.xml
|
|
||||||
~ Copyright (c) 2020 james@firefly-iii.org
|
|
||||||
~
|
|
||||||
~ This file is part of Firefly III (https://github.com/firefly-iii).
|
|
||||||
~
|
|
||||||
~ This program is free software: you can redistribute it and/or modify
|
|
||||||
~ it under the terms of the GNU Affero General Public License as
|
|
||||||
~ published by the Free Software Foundation, either version 3 of the
|
|
||||||
~ License, or (at your option) any later version.
|
|
||||||
~
|
|
||||||
~ This program is distributed in the hope that it will be useful,
|
|
||||||
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
~ GNU Affero General Public License for more details.
|
|
||||||
~
|
|
||||||
~ You should have received a copy of the GNU Affero General Public License
|
|
||||||
~ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
||||||
-->
|
|
||||||
|
|
||||||
<phpunit backupGlobals="false"
|
|
||||||
backupStaticAttributes="false"
|
|
||||||
bootstrap="vendor/autoload.php"
|
|
||||||
colors="true"
|
|
||||||
convertErrorsToExceptions="true"
|
|
||||||
convertNoticesToExceptions="true"
|
|
||||||
convertWarningsToExceptions="true"
|
|
||||||
processIsolation="false"
|
|
||||||
stopOnFailure="true">
|
|
||||||
<listeners>
|
|
||||||
<listener class="JohnKary\PHPUnit\Listener\SpeedTrapListener" />
|
|
||||||
</listeners>
|
|
||||||
<testsuites>
|
|
||||||
<testsuite name="Api">
|
|
||||||
<directory suffix="Test.php">./tests/Api</directory>
|
|
||||||
</testsuite>
|
|
||||||
<testsuite name="Unit">
|
|
||||||
<directory suffix="Test.php">./tests/Unit</directory>
|
|
||||||
</testsuite>
|
|
||||||
<testsuite name="Feature">
|
|
||||||
<directory suffix="Test.php">./tests/Feature</directory>
|
|
||||||
</testsuite>
|
|
||||||
</testsuites>
|
|
||||||
<filter>
|
|
||||||
<whitelist processUncoveredFilesFromWhitelist="true">
|
|
||||||
<directory suffix=".php">./app</directory>
|
|
||||||
<exclude>
|
|
||||||
<file>app/Http/breadcrumbs.php</file>
|
|
||||||
</exclude>
|
|
||||||
</whitelist>
|
|
||||||
</filter>
|
|
||||||
<logging>
|
|
||||||
<log type="coverage-clover" target="./storage/build/clover-all.xml" />
|
|
||||||
</logging>
|
|
||||||
<php>
|
|
||||||
<env name="APP_ENV" value="testing"/>
|
|
||||||
<env name="CACHE_DRIVER" value="array"/>
|
|
||||||
<env name="SESSION_DRIVER" value="array"/>
|
|
||||||
<env name="QUEUE_DRIVER" value="sync"/>
|
|
||||||
</php>
|
|
||||||
</phpunit>
|
|
@ -37,12 +37,14 @@
|
|||||||
<testsuite name="Api">
|
<testsuite name="Api">
|
||||||
<directory suffix="Test.php">./tests/Api</directory>
|
<directory suffix="Test.php">./tests/Api</directory>
|
||||||
</testsuite>
|
</testsuite>
|
||||||
|
<!--
|
||||||
<testsuite name="Unit">
|
<testsuite name="Unit">
|
||||||
<directory suffix="Test.php">./tests/Unit</directory>
|
<directory suffix="Test.php">./tests/Unit</directory>
|
||||||
</testsuite>
|
</testsuite>
|
||||||
<testsuite name="Feature">
|
<testsuite name="Feature">
|
||||||
<directory suffix="Test.php">./tests/Feature</directory>
|
<directory suffix="Test.php">./tests/Feature</directory>
|
||||||
</testsuite>
|
</testsuite>
|
||||||
|
-->
|
||||||
</testsuites>
|
</testsuites>
|
||||||
<filter>
|
<filter>
|
||||||
<whitelist processUncoveredFilesFromWhitelist="true">
|
<whitelist processUncoveredFilesFromWhitelist="true">
|
||||||
|
@ -29,7 +29,6 @@ use FireflyIII\Repositories\Category\NoCategoryRepositoryInterface;
|
|||||||
use FireflyIII\Repositories\Category\OperationsRepositoryInterface;
|
use FireflyIII\Repositories\Category\OperationsRepositoryInterface;
|
||||||
use Laravel\Passport\Passport;
|
use Laravel\Passport\Passport;
|
||||||
use Log;
|
use Log;
|
||||||
use Tests\Support\TestDataTrait;
|
|
||||||
use Tests\TestCase;
|
use Tests\TestCase;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -40,8 +39,6 @@ use Tests\TestCase;
|
|||||||
*/
|
*/
|
||||||
class CategoryControllerTest extends TestCase
|
class CategoryControllerTest extends TestCase
|
||||||
{
|
{
|
||||||
use TestDataTrait;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
@ -24,9 +24,9 @@ declare(strict_types=1);
|
|||||||
namespace Tests\Api\V1\Controllers;
|
namespace Tests\Api\V1\Controllers;
|
||||||
|
|
||||||
|
|
||||||
|
use Faker\Factory;
|
||||||
use FireflyIII\Repositories\User\UserRepositoryInterface;
|
use FireflyIII\Repositories\User\UserRepositoryInterface;
|
||||||
use FireflyIII\Transformers\UserTransformer;
|
use FireflyIII\Transformers\UserTransformer;
|
||||||
use FireflyIII\User;
|
|
||||||
use Laravel\Passport\Passport;
|
use Laravel\Passport\Passport;
|
||||||
use Log;
|
use Log;
|
||||||
use Mockery;
|
use Mockery;
|
||||||
@ -49,7 +49,6 @@ class UserControllerTest extends TestCase
|
|||||||
parent::setUp();
|
parent::setUp();
|
||||||
Passport::actingAs($this->user());
|
Passport::actingAs($this->user());
|
||||||
$this->mockDefaultConfiguration();
|
$this->mockDefaultConfiguration();
|
||||||
Log::info(sprintf('Now in %s.', get_class($this)));
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -61,7 +60,13 @@ class UserControllerTest extends TestCase
|
|||||||
*/
|
*/
|
||||||
public function testStoreBasic(): void
|
public function testStoreBasic(): void
|
||||||
{
|
{
|
||||||
$this->assertTrue(true);
|
Log::info(sprintf('Now in test %s.', __METHOD__));
|
||||||
}
|
// random user
|
||||||
|
$faker = Factory::create();
|
||||||
|
$data = ['email' => $faker->email,];
|
||||||
|
|
||||||
|
// test API
|
||||||
|
$response = $this->post(route('api.v1.users.store'), $data, ['Content-Type' => 'application/x-www-form-urlencoded', 'Accept' => 'application/json']);
|
||||||
|
$response->assertStatus(200);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -25,6 +25,7 @@ namespace Tests;
|
|||||||
|
|
||||||
use FireflyIII\User;
|
use FireflyIII\User;
|
||||||
use Illuminate\Foundation\Testing\TestCase as BaseTestCase;
|
use Illuminate\Foundation\Testing\TestCase as BaseTestCase;
|
||||||
|
use Tests\Traits\CollectsValues;
|
||||||
use Tests\Traits\MocksDefaultValues;
|
use Tests\Traits\MocksDefaultValues;
|
||||||
use Tests\Traits\TestHelpers;
|
use Tests\Traits\TestHelpers;
|
||||||
|
|
||||||
@ -33,7 +34,7 @@ use Tests\Traits\TestHelpers;
|
|||||||
*/
|
*/
|
||||||
abstract class TestCase extends BaseTestCase
|
abstract class TestCase extends BaseTestCase
|
||||||
{
|
{
|
||||||
use CreatesApplication, MocksDefaultValues, TestHelpers;
|
use CreatesApplication, MocksDefaultValues, TestHelpers, CollectsValues;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return array
|
* @return array
|
||||||
@ -50,14 +51,4 @@ abstract class TestCase extends BaseTestCase
|
|||||||
'custom range' => ['custom'],
|
'custom range' => ['custom'],
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @return User
|
|
||||||
*/
|
|
||||||
public function user(): User
|
|
||||||
{
|
|
||||||
return User::find(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user