1
0
mirror of https://github.com/flarum/core.git synced 2025-07-31 13:40:20 +02:00

Remove deprecated code from beta 16 (#2705)

This commit is contained in:
Alexander Skvortsov
2021-03-19 14:13:50 -04:00
committed by GitHub
parent dd2712d5c8
commit 897e778800
40 changed files with 59 additions and 689 deletions

View File

@@ -10,7 +10,6 @@
namespace Flarum\Tests\integration\api\posts;
use Carbon\Carbon;
use Flarum\Event\ConfigurePostsQuery;
use Flarum\Testing\integration\RetrievesAuthorizedUsers;
use Flarum\Testing\integration\TestCase;
use Illuminate\Support\Arr;
@@ -114,44 +113,6 @@ class ListTests extends TestCase
$this->assertEquals(['1', '2', '3', '4', '5'], Arr::pluck($data['data'], 'id'));
}
/**
* @test
* @deprecated
*/
public function user_filter_works()
{
$response = $this->send(
$this->request('GET', '/api/posts', ['authenticatedAs' => 1])
->withQueryParams([
'filter' => ['user' => 'admin'],
])
);
$this->assertEquals(200, $response->getStatusCode());
$data = json_decode($response->getBody()->getContents(), true);
$this->assertEquals(['1', '2'], Arr::pluck($data['data'], 'id'));
}
/**
* @test
* @deprecated
*/
public function user_filter_works_with_multiple_values()
{
$response = $this->send(
$this->request('GET', '/api/posts', ['authenticatedAs' => 1])
->withQueryParams([
'filter' => ['user' => 'admin,normal'],
])
);
$this->assertEquals(200, $response->getStatusCode());
$data = json_decode($response->getBody()->getContents(), true);
$this->assertEquals(['1', '2', '3', '4', '5'], Arr::pluck($data['data'], 'id'));
}
/**
* @test
*/
@@ -241,24 +202,4 @@ class ListTests extends TestCase
$this->assertEquals(['1', '3', '5'], Arr::pluck($data['data'], 'id'));
}
/**
* @deprecated beta 16, remove beta 17
* @test
*/
public function deprecated_configure_posts_query_extension_still_works()
{
$this->app()->getContainer()->make('events')->listen(ConfigurePostsQuery::class, function (ConfigurePostsQuery $event) {
$event->query->where('id', '1');
});
$response = $this->send(
$this->request('GET', '/api/posts', ['authenticatedAs' => 1])
);
$this->assertEquals(200, $response->getStatusCode());
$data = json_decode($response->getBody()->getContents(), true);
$this->assertEquals(['1'], Arr::pluck($data['data'], 'id'));
}
}

View File

@@ -31,7 +31,7 @@ class ModelPrivateTest extends TestCase
$discussion = Discussion::start('Some Discussion', $user);
$discussion->save();
$this->assertFalse($discussion->is_private);
$this->assertNull($discussion->is_private);
}
/**