Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 13 additions & 4 deletions tests/Misd/Linkify/Test/LinkifyTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,19 @@ public function emailProvider()

public function ignoreProvider()
{
return array(
array($this->loadData('ignore.json')),
array($this->loadData('ignore-options.json')),
);
$out = array();
foreach(array(
$this->loadData('ignore.json'),
$this->loadData('ignore-options.json'),
) as $data) {
foreach($data['tests'] as $test) {
$out[] = array(
$data['options'],
$test,
);
}
}
return $out;
}

public function callbackProvider()
Expand Down
9 changes: 3 additions & 6 deletions tests/Misd/Linkify/Test/ProcessEmailsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,9 @@ public function avoidUrlLinks(array $data)
* @test
* @dataProvider ignoreProvider
*/
public function avoidNonLinks(array $data)
public function avoidNonLinks(array $options, $test)
{
$linkify = new Linkify($data['options']);

foreach ($data['tests'] as $test) {
$this->assertEquals($test, $linkify->processEmails($test));
}
$linkify = new Linkify($options);
$this->assertEquals($test, $linkify->processEmails($test));
}
}
9 changes: 3 additions & 6 deletions tests/Misd/Linkify/Test/ProcessTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,9 @@ public function makeEmailLinks(array $data)
* @test
* @dataProvider ignoreProvider
*/
public function avoidNonLinks(array $data)
public function avoidNonLinks(array $options, $test)
{
$linkify = new Linkify($data['options']);

foreach ($data['tests'] as $test) {
$this->assertEquals($test, $linkify->process($test));
}
$linkify = new Linkify($options);
$this->assertEquals($test, $linkify->process($test));
}
}
9 changes: 3 additions & 6 deletions tests/Misd/Linkify/Test/ProcessUrlsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,9 @@ public function avoidEmailLinks(array $data)
* @test
* @dataProvider ignoreProvider
*/
public function avoidNonLinks(array $data)
public function avoidNonLinks(array $options, $test)
{
$linkify = new Linkify($data['options']);

foreach ($data['tests'] as $test) {
$this->assertEquals($test, $linkify->processUrls($test));
}
$linkify = new Linkify($options);
$this->assertEquals($test, $linkify->processUrls($test));
}
}