Skip to content

Commit

Permalink
Fix usage of assertSame function
Browse files Browse the repository at this point in the history
  • Loading branch information
gmazzap committed Mar 6, 2023
1 parent a537104 commit ad004f7
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions tests/unit/Util/WpConfigSectionEditorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@
use WeCodeMore\WpStarter\Tests\TestCase;
use WeCodeMore\WpStarter\Util\WpConfigSectionEditor;

use function PHPUnit\Framework\assertSame;

class WpConfigSectionEditorTest extends TestCase
{
/**
Expand Down Expand Up @@ -69,8 +67,8 @@ public function testEditSection(bool $repeat = false): void
static::assertSame("# </{$matches[1]}>", array_shift($lines));

if ($repeat) {
assertSame(2, substr_count($currentContent, 'New line 1'));
assertSame(2, substr_count($currentContent, 'New line 2'));
static::assertSame(2, substr_count($currentContent, 'New line 1'));
static::assertSame(2, substr_count($currentContent, 'New line 2'));
}

if (!$repeat) {
Expand Down Expand Up @@ -108,10 +106,10 @@ public function testReplaceSection(bool $repeat = false): void
static::assertSame([], $linesThree);

if ($repeat) {
assertSame(1, substr_count($currentContentTwo, 'New line 1'));
assertSame(1, substr_count($currentContentTwo, 'New line 2'));
assertSame(2, substr_count($currentContentThree, 'New line 1'));
assertSame(2, substr_count($currentContentThree, 'New line 2'));
static::assertSame(1, substr_count($currentContentTwo, 'New line 1'));
static::assertSame(1, substr_count($currentContentTwo, 'New line 2'));
static::assertSame(2, substr_count($currentContentThree, 'New line 1'));
static::assertSame(2, substr_count($currentContentThree, 'New line 2'));
}

if (!$repeat) {
Expand Down

0 comments on commit ad004f7

Please sign in to comment.