Skip to content

Commit

Permalink
Added last tests. Closes #31
Browse files Browse the repository at this point in the history
  • Loading branch information
SerhiiCho committed Jan 16, 2022
1 parent 235feee commit 6d1eb84
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions tests/TimeAgoTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -125,10 +125,23 @@ public function provider_for_trans_method_returns_correct_result_after_passing_a
];
}

/** @test */
public function trans_method_throws_exception_if_input_has_incorrect_string(): void
/**
* @dataProvider provider_for_trans_method_throws_exception_if_input_has_incorrect_string
* @test
*/
public function trans_method_throws_exception_if_input_has_incorrect_string(string $input): void
{
$this->expectException(InvalidDateFormatException::class);
TimeAgo::trans('sfdafsd');
TimeAgo::trans($input);
}

public function provider_for_trans_method_throws_exception_if_input_has_incorrect_string(): array
{
return [
['sfdafsd'],
['safjldkfj'],
['afjdsalkfjdsklfj'],
['__'],
];
}
}

0 comments on commit 6d1eb84

Please sign in to comment.