Files
ops-Logchecker/tests/Check/RipperTest.php
2024-02-01 15:38:54 +00:00

54 lines
1.6 KiB
PHP
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?php
declare(strict_types=1);
namespace OrpheusNET\Logchecker\Check;
use PHPUnit\Framework\TestCase;
use OrpheusNET\Logchecker\Exception\UnknownRipperException;
class RipperTest extends TestCase
{
public static function ripperDataProvider()
{
return [
[
"Exact Audio Copy V1.3 from 2. September 2016\n\nEAC extraction logfile from 11. December 2016, 0:14",
Ripper::EAC
],
[
"EAC 展開 ログファイル 日付: 24. 12月 2005, 18:37 for CD\nTest",
Ripper::EAC
],
[
"Отчёт EAC об извлечении, выполненном 15. января 2010, 16:06 для диска:\n" .
"Girls Against Boys / Cruise Yourself",
Ripper::EAC
],
[
"Log created by: whipper 0.7.0 (internal logger)\nLog creation date: 2018-11-23T15:19:21Z",
Ripper::WHIPPER
],
[
"X Lossless Decoder version 20161007 (149.3)\n\nXLD extraction logfile from 2017-01-04 18:59:53 -0500",
Ripper::XLD
]
];
}
/**
* @dataProvider ripperDataProvider
*/
public function testGetRipper($testString, $ripper)
{
$this->assertSame($ripper, Ripper::getRipper($testString));
}
public function testInvalidRipper()
{
$this->expectException(UnknownRipperException::class);
$this->expectExceptionMessage('Could not determine ripper');
Ripper::getRipper('invalid invalid invalid');
}
}