mirror of
https://git.sekbaer.de/Friendica/friendica.git
synced 2025-06-08 00:04:27 +02:00
Restructure tests
- Avoid database leftovers
This commit is contained in:
parent
704508fc65
commit
e1813e3d73
11 changed files with 161 additions and 104 deletions
|
@ -21,15 +21,15 @@
|
|||
|
||||
namespace Friendica\Test\src\Console;
|
||||
|
||||
use Dice\Dice;
|
||||
use Friendica\Console\ServerBlock;
|
||||
use Friendica\Core\Config\Capability\IManageConfigValues;
|
||||
use Friendica\DI;
|
||||
use Friendica\Moderation\DomainPatternBlocklist;
|
||||
use Friendica\Test\FixtureTestTrait;
|
||||
use Mockery;
|
||||
|
||||
class ServerBlockConsoleTest extends ConsoleTest
|
||||
{
|
||||
use FixtureTestTrait;
|
||||
|
||||
protected $defaultBlockList = [
|
||||
[
|
||||
'domain' => 'social.nobodyhasthe.biz',
|
||||
|
@ -49,9 +49,18 @@ class ServerBlockConsoleTest extends ConsoleTest
|
|||
{
|
||||
parent::setUp();
|
||||
|
||||
$this->setUpFixtures();
|
||||
|
||||
$this->blocklistMock = Mockery::mock(DomainPatternBlocklist::class);
|
||||
}
|
||||
|
||||
protected function tearDown(): void
|
||||
{
|
||||
$this->tearDownFixtures();
|
||||
|
||||
parent::tearDown();
|
||||
}
|
||||
|
||||
/**
|
||||
* Test to list the default blocked servers
|
||||
*/
|
||||
|
@ -80,11 +89,6 @@ CONS;
|
|||
*/
|
||||
public function testAddBlockedServer()
|
||||
{
|
||||
$dice = new Dice();
|
||||
$dice = $dice->addRules(include __DIR__ . '/../../../static/dependencies.config.php');
|
||||
|
||||
DI::init($dice, true);
|
||||
|
||||
$this->blocklistMock
|
||||
->shouldReceive('addPattern')
|
||||
->with('testme.now', 'I like it!')
|
||||
|
@ -105,11 +109,6 @@ CONS;
|
|||
*/
|
||||
public function testUpdateBlockedServer()
|
||||
{
|
||||
$dice = new Dice();
|
||||
$dice = $dice->addRules(include __DIR__ . '/../../../static/dependencies.config.php');
|
||||
|
||||
DI::init($dice, true);
|
||||
|
||||
$this->blocklistMock
|
||||
->shouldReceive('addPattern')
|
||||
->with('pod.ordoevangelistarum.com', 'Other reason')
|
||||
|
@ -130,11 +129,6 @@ CONS;
|
|||
*/
|
||||
public function testRemoveBlockedServer()
|
||||
{
|
||||
$dice = new Dice();
|
||||
$dice = $dice->addRules(include __DIR__ . '/../../../static/dependencies.config.php');
|
||||
|
||||
DI::init($dice, true);
|
||||
|
||||
$this->blocklistMock
|
||||
->shouldReceive('removePattern')
|
||||
->with('pod.ordoevangelistarum.com')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue