Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

50 rader
1.4 KiB

  1. <?php
  2. declare(strict_types=1);
  3. namespace OrpheusNET\Logchecker\Checks;
  4. use PHPUnit\Framework\TestCase;
  5. use OrpheusNET\Logchecker\Checks\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",
  18. Ripper::EAC
  19. ],
  20. [
  21. "Log created by: whipper 0.7.0 (internal logger)\nLog creation date: 2018-11-23T15:19:21Z",
  22. Ripper::WHIPPER
  23. ],
  24. [
  25. "X Lossless Decoder version 20161007 (149.3)\n\nXLD extraction logfile from 2017-01-04 18:59:53 -0500",
  26. Ripper::XLD
  27. ]
  28. ];
  29. }
  30. /**
  31. * @dataProvider ripperDataProvider
  32. */
  33. public function testGetRipper($testString, $ripper)
  34. {
  35. $this->assertSame($ripper, Ripper::getRipper($testString));
  36. }
  37. public function testInvalidRipper()
  38. {
  39. $this->expectException(UnknownRipperException::class);
  40. $this->expectExceptionMessage('Could not determine ripper');
  41. Ripper::getRipper('invalid invalid invalid');
  42. }
  43. }