Skip to content

Commit

Permalink
Test for strings within strings as of phpunit 7.5
Browse files Browse the repository at this point in the history
The old way is deprecated from phpunit 8.0

sebastianbergmann/phpunit#3422
  • Loading branch information
superstarlancer committed Feb 28, 2019
1 parent 0f23525 commit 5ffcb42
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion composer.json
Expand Up @@ -26,7 +26,7 @@
"require-dev": {
"orchestra/testbench": "~3.6",
"laravel/framework": ">=5.6.25",
"phpunit/phpunit": ">6.5",
"phpunit/phpunit": ">=7.5",
"erusev/parsedown": "^1.7",
"graham-campbell/markdown": "^10.0",
"mockery/mockery": "^1.0",
Expand Down
8 changes: 4 additions & 4 deletions tests/Feature/GrahamCampbellMarkdownBlogEntryTest.php
Expand Up @@ -28,8 +28,8 @@ public function test_body_markdown_is_parsed()

$html_string = $entry->getContent()->toHtml();

$this->assertContains('<h1>The Headline</h1>', $html_string);
$this->assertContains('<p>A <em>paragraph</em></p>', $html_string);
$this->assertStringContainsString('<h1>The Headline</h1>', $html_string);
$this->assertStringContainsString('<p>A <em>paragraph</em></p>', $html_string);
}

public function test_image_markdown_is_parsed()
Expand All @@ -39,7 +39,7 @@ public function test_image_markdown_is_parsed()

$html_string = $entry->getImage()->toHtml();

$this->assertContains('alt="Alt text"', $html_string);
$this->assertContains('title="Optional title"', $html_string);
$this->assertStringContainsString('alt="Alt text"', $html_string);
$this->assertStringContainsString('title="Optional title"', $html_string);
}
}
8 changes: 4 additions & 4 deletions tests/Feature/ParsedownBlogEntryTest.php
Expand Up @@ -18,8 +18,8 @@ public function test_body_markdown_is_parsed()

$html_string = $entry->getContent()->toHtml();

$this->assertContains('<h1>The Headline</h1>', $html_string);
$this->assertContains('<p>A <em>paragraph</em></p>', $html_string);
$this->assertStringContainsString('<h1>The Headline</h1>', $html_string);
$this->assertStringContainsString('<p>A <em>paragraph</em></p>', $html_string);
}

public function test_image_markdown_is_parsed()
Expand All @@ -29,7 +29,7 @@ public function test_image_markdown_is_parsed()

$html_string = $entry->getImage()->toHtml();

$this->assertContains('alt="Alt text"', $html_string);
$this->assertContains('title="Optional title"', $html_string);
$this->assertStringContainsString('alt="Alt text"', $html_string);
$this->assertStringContainsString('title="Optional title"', $html_string);
}
}

0 comments on commit 5ffcb42

Please sign in to comment.