QRStringTest.php 896 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <?php
  2. /**
  3. * Class QRStringTest
  4. *
  5. * @filesource QRStringTest.php
  6. * @created 24.12.2017
  7. * @package chillerlan\QRCodeTest\Output
  8. * @author Smiley <smiley@chillerlan.net>
  9. * @copyright 2017 Smiley
  10. * @license MIT
  11. */
  12. namespace chillerlan\QRCodeTest\Output;
  13. use chillerlan\QRCode\Output\QRString;
  14. use chillerlan\QRCode\QRCode;
  15. class QRStringTest extends QROutputTestAbstract{
  16. protected $FQCN = QRString::class;
  17. public function types(){
  18. return [
  19. [QRCode::OUTPUT_STRING_JSON],
  20. [QRCode::OUTPUT_STRING_TEXT],
  21. ];
  22. }
  23. /**
  24. * @dataProvider types
  25. * @param $type
  26. */
  27. public function testStringOutput($type){
  28. $this->options->outputType = $type;
  29. $this->options->cachefile = $this::cachefile.$type;
  30. $this->setOutputInterface();
  31. $data = $this->outputInterface->dump();
  32. $this->assertSame($data, file_get_contents($this->options->cachefile));
  33. }
  34. }