mirror of
https://github.com/flarum/framework.git
synced 2024-11-25 17:57:04 +08:00
Move integration tests to separate directory
Again, we do all of this to prepare for creating "real" test suites for each type of tests.
This commit is contained in:
parent
ba16ebe61f
commit
4d10536d35
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -4,6 +4,6 @@ composer.phar
|
||||||
node_modules
|
node_modules
|
||||||
.DS_Store
|
.DS_Store
|
||||||
Thumbs.db
|
Thumbs.db
|
||||||
/tests/tmp
|
/tests/integration/tmp
|
||||||
.vagrant
|
.vagrant
|
||||||
.idea/*
|
.idea/*
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
* file that was distributed with this source code.
|
* file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Flarum\Tests\Test\Concerns;
|
namespace Flarum\Tests\integration;
|
||||||
|
|
||||||
use Flarum\Database\DatabaseMigrationRepository;
|
use Flarum\Database\DatabaseMigrationRepository;
|
||||||
use Flarum\Database\Migrator;
|
use Flarum\Database\Migrator;
|
||||||
|
@ -57,9 +57,9 @@ trait CreatesForum
|
||||||
protected function createsSite()
|
protected function createsSite()
|
||||||
{
|
{
|
||||||
$paths = [
|
$paths = [
|
||||||
'base' => __DIR__.'/../../tmp',
|
'base' => __DIR__.'/tmp',
|
||||||
'public' => __DIR__.'/../../tmp/public',
|
'public' => __DIR__.'/tmp/public',
|
||||||
'storage' => __DIR__.'/../../tmp/storage',
|
'storage' => __DIR__.'/tmp/storage',
|
||||||
];
|
];
|
||||||
|
|
||||||
if ($this->isInstalled) {
|
if ($this->isInstalled) {
|
|
@ -9,7 +9,7 @@
|
||||||
* file that was distributed with this source code.
|
* file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Flarum\Tests\Test\Concerns;
|
namespace Flarum\Tests\integration;
|
||||||
|
|
||||||
use Flarum\Api\Client;
|
use Flarum\Api\Client;
|
||||||
use Flarum\User\Guest;
|
use Flarum\User\Guest;
|
|
@ -9,7 +9,7 @@
|
||||||
* file that was distributed with this source code.
|
* file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Flarum\Tests\Test\Concerns;
|
namespace Flarum\Tests\integration;
|
||||||
|
|
||||||
use Flarum\Post\CommentPost;
|
use Flarum\Post\CommentPost;
|
||||||
use Flarum\Post\Event\Posted;
|
use Flarum\Post\Event\Posted;
|
|
@ -9,7 +9,7 @@
|
||||||
* file that was distributed with this source code.
|
* file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Flarum\Tests\Test\Concerns;
|
namespace Flarum\Tests\integration;
|
||||||
|
|
||||||
use Flarum\User\User;
|
use Flarum\User\User;
|
||||||
|
|
|
@ -9,14 +9,14 @@
|
||||||
* file that was distributed with this source code.
|
* file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Flarum\Tests\Test;
|
namespace Flarum\Tests\integration;
|
||||||
|
|
||||||
use PHPUnit\Framework\TestCase as Test;
|
use PHPUnit\Framework\TestCase as Test;
|
||||||
|
|
||||||
abstract class TestCase extends Test
|
abstract class TestCase extends Test
|
||||||
{
|
{
|
||||||
use Concerns\CreatesForum,
|
use CreatesForum,
|
||||||
Concerns\MakesApiRequests;
|
MakesApiRequests;
|
||||||
|
|
||||||
public function setUp()
|
public function setUp()
|
||||||
{
|
{
|
|
@ -9,13 +9,13 @@
|
||||||
* file that was distributed with this source code.
|
* file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Flarum\Tests\Api\Auth;
|
namespace Flarum\Tests\integration\api\Auth;
|
||||||
|
|
||||||
use Carbon\Carbon;
|
use Carbon\Carbon;
|
||||||
use Flarum\Api\ApiKey;
|
use Flarum\Api\ApiKey;
|
||||||
use Flarum\Api\Controller\CreateGroupController;
|
use Flarum\Api\Controller\CreateGroupController;
|
||||||
use Flarum\Tests\Test\Concerns\RetrievesAuthorizedUsers;
|
use Flarum\Tests\integration\RetrievesAuthorizedUsers;
|
||||||
use Flarum\Tests\Test\TestCase;
|
use Flarum\Tests\integration\TestCase;
|
||||||
use Psr\Http\Message\ResponseInterface;
|
use Psr\Http\Message\ResponseInterface;
|
||||||
use Psr\Http\Message\ServerRequestInterface;
|
use Psr\Http\Message\ServerRequestInterface;
|
||||||
use Psr\Http\Server\MiddlewareInterface;
|
use Psr\Http\Server\MiddlewareInterface;
|
|
@ -9,10 +9,10 @@
|
||||||
* file that was distributed with this source code.
|
* file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Flarum\Tests\Api\Controller;
|
namespace Flarum\Tests\integration\api\Controller;
|
||||||
|
|
||||||
use Flarum\Tests\Test\Concerns\RetrievesAuthorizedUsers;
|
use Flarum\Tests\integration\RetrievesAuthorizedUsers;
|
||||||
use Flarum\Tests\Test\TestCase;
|
use Flarum\Tests\integration\TestCase;
|
||||||
use Flarum\User\User;
|
use Flarum\User\User;
|
||||||
use Illuminate\Support\Arr;
|
use Illuminate\Support\Arr;
|
||||||
use Psr\Http\Message\ResponseInterface;
|
use Psr\Http\Message\ResponseInterface;
|
|
@ -9,7 +9,7 @@
|
||||||
* file that was distributed with this source code.
|
* file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Flarum\Tests\Api\Controller;
|
namespace Flarum\Tests\integration\api\Controller;
|
||||||
|
|
||||||
use Flarum\Api\Controller\CreateDiscussionController;
|
use Flarum\Api\Controller\CreateDiscussionController;
|
||||||
use Flarum\Discussion\Discussion;
|
use Flarum\Discussion\Discussion;
|
|
@ -9,7 +9,7 @@
|
||||||
* file that was distributed with this source code.
|
* file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Flarum\Tests\Api\Controller;
|
namespace Flarum\Tests\integration\api\Controller;
|
||||||
|
|
||||||
use Flarum\Api\Controller\CreateGroupController;
|
use Flarum\Api\Controller\CreateGroupController;
|
||||||
use Flarum\Group\Group;
|
use Flarum\Group\Group;
|
|
@ -9,7 +9,7 @@
|
||||||
* file that was distributed with this source code.
|
* file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Flarum\Tests\Api\Controller;
|
namespace Flarum\Tests\integration\api\Controller;
|
||||||
|
|
||||||
use Flarum\Api\Controller\CreatePostController;
|
use Flarum\Api\Controller\CreatePostController;
|
||||||
use Flarum\Discussion\Discussion;
|
use Flarum\Discussion\Discussion;
|
|
@ -9,7 +9,7 @@
|
||||||
* file that was distributed with this source code.
|
* file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Flarum\Tests\Api\Controller;
|
namespace Flarum\Tests\integration\api\Controller;
|
||||||
|
|
||||||
use Flarum\Api\Controller\CreateTokenController;
|
use Flarum\Api\Controller\CreateTokenController;
|
||||||
use Flarum\Http\AccessToken;
|
use Flarum\Http\AccessToken;
|
|
@ -9,7 +9,7 @@
|
||||||
* file that was distributed with this source code.
|
* file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Flarum\Tests\Api\Controller;
|
namespace Flarum\Tests\integration\api\Controller;
|
||||||
|
|
||||||
use Flarum\Api\Controller\CreateUserController;
|
use Flarum\Api\Controller\CreateUserController;
|
||||||
use Flarum\Settings\SettingsRepositoryInterface;
|
use Flarum\Settings\SettingsRepositoryInterface;
|
|
@ -9,7 +9,7 @@
|
||||||
* file that was distributed with this source code.
|
* file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Flarum\Tests\Api\Controller;
|
namespace Flarum\Tests\integration\api\Controller;
|
||||||
|
|
||||||
use Flarum\Api\Controller\DeleteDiscussionController;
|
use Flarum\Api\Controller\DeleteDiscussionController;
|
||||||
use Flarum\Discussion\Discussion;
|
use Flarum\Discussion\Discussion;
|
|
@ -9,7 +9,7 @@
|
||||||
* file that was distributed with this source code.
|
* file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Flarum\Tests\Api\Controller;
|
namespace Flarum\Tests\integration\api\Controller;
|
||||||
|
|
||||||
use Flarum\Api\Controller\ListDiscussionsController;
|
use Flarum\Api\Controller\ListDiscussionsController;
|
||||||
use Flarum\Discussion\Discussion;
|
use Flarum\Discussion\Discussion;
|
|
@ -9,7 +9,7 @@
|
||||||
* file that was distributed with this source code.
|
* file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Flarum\Tests\Api\Controller;
|
namespace Flarum\Tests\integration\api\Controller;
|
||||||
|
|
||||||
use Flarum\Api\Controller\ListGroupsController;
|
use Flarum\Api\Controller\ListGroupsController;
|
||||||
use Flarum\Group\Group;
|
use Flarum\Group\Group;
|
|
@ -9,7 +9,7 @@
|
||||||
* file that was distributed with this source code.
|
* file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Flarum\Tests\Api\Controller;
|
namespace Flarum\Tests\integration\api\Controller;
|
||||||
|
|
||||||
use Flarum\Api\Controller\ListNotificationsController;
|
use Flarum\Api\Controller\ListNotificationsController;
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
* file that was distributed with this source code.
|
* file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Flarum\Tests\Api\Controller;
|
namespace Flarum\Tests\integration\api\Controller;
|
||||||
|
|
||||||
use Flarum\Api\Controller\ListUsersController;
|
use Flarum\Api\Controller\ListUsersController;
|
||||||
|
|
|
@ -9,11 +9,11 @@
|
||||||
* file that was distributed with this source code.
|
* file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Flarum\Tests\Api\Controller;
|
namespace Flarum\Tests\integration\api\Controller;
|
||||||
|
|
||||||
use Flarum\Api\Controller\ShowDiscussionController;
|
use Flarum\Api\Controller\ShowDiscussionController;
|
||||||
use Flarum\Discussion\Discussion;
|
use Flarum\Discussion\Discussion;
|
||||||
use Flarum\Tests\Test\Concerns\ManagesContent;
|
use Flarum\Tests\integration\ManagesContent;
|
||||||
|
|
||||||
class ShowDiscussionControllerTest extends ApiControllerTestCase
|
class ShowDiscussionControllerTest extends ApiControllerTestCase
|
||||||
{
|
{
|
|
@ -9,7 +9,7 @@
|
||||||
* file that was distributed with this source code.
|
* file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Flarum\Tests\Api\Controller;
|
namespace Flarum\Tests\integration\api\Controller;
|
||||||
|
|
||||||
use Flarum\Api\Controller\UpdateUserController;
|
use Flarum\Api\Controller\UpdateUserController;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user