Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
stevebauman committed Oct 16, 2019
1 parent 96cec18 commit 75447eb
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 17 deletions.
1 change: 0 additions & 1 deletion phpunit.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false"
syntaxCheck="false"
>
<testsuites>
<testsuite name="Purify Test Suite">
Expand Down
19 changes: 5 additions & 14 deletions tests/PurifyTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace Stevebauman\Purify\Tests;

use HTMLPurifier;
use HTMLPurifier_ConfigSchema;
use Stevebauman\Purify\Facades\Purify;

Expand Down Expand Up @@ -50,32 +51,22 @@ public function given_config_overwrites_default_config()
}

/** @test */
public function purify_loads_default_config_when_null()
public function purify_loads_default_config()
{
config(['purify.settings' => null]);

$this->assertEquals(HTMLPurifier_ConfigSchema::instance()->defaults, Purify::getSettings());
}

/** @test */
public function purify_loads_default_config_when_empty()
{
config(['purify.settings' => []]);

$this->assertEquals(HTMLPurifier_ConfigSchema::instance()->defaults, Purify::getSettings());
}

/** @test */
public function purifier_instance_is_accessible()
{
$this->assertInstanceOf('HTMLPurifier', Purify::getPurifier());
$this->assertInstanceOf(HTMLPurifier::class, Purify::getPurifier());
}

/** @test */
public function purifier_instance_can_be_set()
{
$purifier = new \HTMLPurifier();
$purifier = new HTMLPurifier();

$this->assertInstanceOf('HTMLPurifier', Purify::setPurifier($purifier)->getPurifier());
$this->assertInstanceOf(HTMLPurifier::class, Purify::setPurifier($purifier)->getPurifier());
}
}
6 changes: 4 additions & 2 deletions tests/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,23 @@

namespace Stevebauman\Purify\Tests;

use Stevebauman\Purify\Facades\Purify;
use Stevebauman\Purify\PurifyServiceProvider;
use Orchestra\Testbench\TestCase as BaseTestCase;

class TestCase extends BaseTestCase
{
protected function getPackageAliases($app)
{
return [
'Purify' => 'Stevebauman\Purify\Facades\Purify',
'Purify' => Purify::class,
];
}

protected function getPackageProviders($app)
{
return [
'Stevebauman\Purify\PurifyServiceProvider',
PurifyServiceProvider::class,
];
}
}

0 comments on commit 75447eb

Please sign in to comment.