You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

RipperTest.php 1.6 KiB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. <?php
  2. declare(strict_types=1);
  3. namespace OrpheusNET\Logchecker\Check;
  4. use PHPUnit\Framework\TestCase;
  5. use OrpheusNET\Logchecker\Check\Ripper;
  6. use OrpheusNET\Logchecker\Exception\UnknownRipperException;
  7. class RipperTest extends TestCase
  8. {
  9. public function ripperDataProvider()
  10. {
  11. return [
  12. [
  13. "Exact Audio Copy V1.3 from 2. September 2016\n\nEAC extraction logfile from 11. December 2016, 0:14",
  14. Ripper::EAC
  15. ],
  16. [
  17. "EAC 展開 ログファイル 日付: 24. 12月 2005, 18:37 for CD\nTest",
  18. Ripper::EAC
  19. ],
  20. [
  21. "Отчёт EAC об извлечении, выполненном 15. января 2010, 16:06 для диска:\n" .
  22. "Girls Against Boys / Cruise Yourself",
  23. Ripper::EAC
  24. ],
  25. [
  26. "Log created by: whipper 0.7.0 (internal logger)\nLog creation date: 2018-11-23T15:19:21Z",
  27. Ripper::WHIPPER
  28. ],
  29. [
  30. "X Lossless Decoder version 20161007 (149.3)\n\nXLD extraction logfile from 2017-01-04 18:59:53 -0500",
  31. Ripper::XLD
  32. ]
  33. ];
  34. }
  35. /**
  36. * @dataProvider ripperDataProvider
  37. */
  38. public function testGetRipper($testString, $ripper)
  39. {
  40. $this->assertSame($ripper, Ripper::getRipper($testString));
  41. }
  42. public function testInvalidRipper()
  43. {
  44. $this->expectException(UnknownRipperException::class);
  45. $this->expectExceptionMessage('Could not determine ripper');
  46. Ripper::getRipper('invalid invalid invalid');
  47. }
  48. }