You are here

public function BarcodeBlockTest::providerBarcodeFormat in Barcodes 2.0.x

Provides test data for testBarcodeFormat().

File

tests/src/Functional/BarcodeBlockTest.php, line 135

Class

BarcodeBlockTest
Tests the Barcodes module block functionality.

Namespace

Drupal\Tests\barcodes\Functional

Code

public function providerBarcodeFormat() {

  // Structure of each element is:
  // - format: Format to test.
  // - value: Value of barcode field.
  // - expected: Barcode markup.
  return [
    'PNG display format.' => [
      'PNG',
      '023130',
      '<img alt="Embedded Image" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABkAQMAAABKLAcXAAAABlBMVEX///8AAABVwtN+AAAAAXRSTlMAQObYZgAAAAlwSFlzAAAOxAAADsQBlSsOGwAAACNJREFUOI1j2CiyOGO3yNLTs67NNTRgGOWN8kZ5o7xRHo15AOGSiPPiFchBAAAAAElFTkSuQmCC" />',
    ],
    'SVG display format.' => [
      'SVG',
      '023130',
      '<svg width="100.000000" height="100.000000" viewBox="0 0 100.000000 100.000000" version="1.1" xmlns="http://www.w3.org/2000/svg">
	<desc>023130</desc>
	<g id="bars" fill="#000000" stroke="none" stroke-width="0" stroke-linecap="square">
		<rect x="0.000000" y="0.000000" width="1.234568" height="100.000000" />
		<rect x="2.469136" y="0.000000" width="2.469136" height="100.000000" />
		<rect x="7.407407" y="0.000000" width="1.234568" height="100.000000" />
		<rect x="11.111111" y="0.000000" width="1.234568" height="100.000000" />
		<rect x="13.580247" y="0.000000" width="1.234568" height="100.000000" />
		<rect x="16.049383" y="0.000000" width="1.234568" height="100.000000" />
		<rect x="18.518519" y="0.000000" width="1.234568" height="100.000000" />
		<rect x="22.222222" y="0.000000" width="2.469136" height="100.000000" />
		<rect x="25.925926" y="0.000000" width="1.234568" height="100.000000" />
		<rect x="28.395062" y="0.000000" width="1.234568" height="100.000000" />
		<rect x="32.098765" y="0.000000" width="1.234568" height="100.000000" />
		<rect x="34.567901" y="0.000000" width="2.469136" height="100.000000" />
		<rect x="38.271605" y="0.000000" width="2.469136" height="100.000000" />
		<rect x="43.209877" y="0.000000" width="1.234568" height="100.000000" />
		<rect x="45.679012" y="0.000000" width="1.234568" height="100.000000" />
		<rect x="48.148148" y="0.000000" width="1.234568" height="100.000000" />
		<rect x="50.617284" y="0.000000" width="1.234568" height="100.000000" />
		<rect x="53.086420" y="0.000000" width="1.234568" height="100.000000" />
		<rect x="55.555556" y="0.000000" width="2.469136" height="100.000000" />
		<rect x="60.493827" y="0.000000" width="1.234568" height="100.000000" />
		<rect x="62.962963" y="0.000000" width="2.469136" height="100.000000" />
		<rect x="67.901235" y="0.000000" width="1.234568" height="100.000000" />
		<rect x="70.370370" y="0.000000" width="1.234568" height="100.000000" />
		<rect x="72.839506" y="0.000000" width="1.234568" height="100.000000" />
		<rect x="75.308642" y="0.000000" width="1.234568" height="100.000000" />
		<rect x="77.777778" y="0.000000" width="1.234568" height="100.000000" />
		<rect x="80.246914" y="0.000000" width="1.234568" height="100.000000" />
		<rect x="83.950617" y="0.000000" width="2.469136" height="100.000000" />
		<rect x="87.654321" y="0.000000" width="1.234568" height="100.000000" />
		<rect x="90.123457" y="0.000000" width="2.469136" height="100.000000" />
		<rect x="95.061728" y="0.000000" width="1.234568" height="100.000000" />
		<rect x="98.765432" y="0.000000" width="1.234568" height="100.000000" />
	</g>
</svg>',
    ],
    'HTMLDIV display format.' => [
      'HTMLDIV',
      '023130',
      '<div class="code"><div style="width:100.000000px;height:100.000000px;position:relative;font-size:0;border:none;padding:0;margin:0;">
	<div style="background-color:rgba(0%,0%,0%,1);left:0.000000px;top:0.000000px;width:1.234568px;height:100.000000px;position:absolute;border:none;padding:0;margin:0;">&nbsp;</div>
	<div style="background-color:rgba(0%,0%,0%,1);left:2.469136px;top:0.000000px;width:2.469136px;height:100.000000px;position:absolute;border:none;padding:0;margin:0;">&nbsp;</div>
	<div style="background-color:rgba(0%,0%,0%,1);left:7.407407px;top:0.000000px;width:1.234568px;height:100.000000px;position:absolute;border:none;padding:0;margin:0;">&nbsp;</div>
	<div style="background-color:rgba(0%,0%,0%,1);left:11.111111px;top:0.000000px;width:1.234568px;height:100.000000px;position:absolute;border:none;padding:0;margin:0;">&nbsp;</div>
	<div style="background-color:rgba(0%,0%,0%,1);left:13.580247px;top:0.000000px;width:1.234568px;height:100.000000px;position:absolute;border:none;padding:0;margin:0;">&nbsp;</div>
	<div style="background-color:rgba(0%,0%,0%,1);left:16.049383px;top:0.000000px;width:1.234568px;height:100.000000px;position:absolute;border:none;padding:0;margin:0;">&nbsp;</div>
	<div style="background-color:rgba(0%,0%,0%,1);left:18.518519px;top:0.000000px;width:1.234568px;height:100.000000px;position:absolute;border:none;padding:0;margin:0;">&nbsp;</div>
	<div style="background-color:rgba(0%,0%,0%,1);left:22.222222px;top:0.000000px;width:2.469136px;height:100.000000px;position:absolute;border:none;padding:0;margin:0;">&nbsp;</div>
	<div style="background-color:rgba(0%,0%,0%,1);left:25.925926px;top:0.000000px;width:1.234568px;height:100.000000px;position:absolute;border:none;padding:0;margin:0;">&nbsp;</div>
	<div style="background-color:rgba(0%,0%,0%,1);left:28.395062px;top:0.000000px;width:1.234568px;height:100.000000px;position:absolute;border:none;padding:0;margin:0;">&nbsp;</div>
	<div style="background-color:rgba(0%,0%,0%,1);left:32.098765px;top:0.000000px;width:1.234568px;height:100.000000px;position:absolute;border:none;padding:0;margin:0;">&nbsp;</div>
	<div style="background-color:rgba(0%,0%,0%,1);left:34.567901px;top:0.000000px;width:2.469136px;height:100.000000px;position:absolute;border:none;padding:0;margin:0;">&nbsp;</div>
	<div style="background-color:rgba(0%,0%,0%,1);left:38.271605px;top:0.000000px;width:2.469136px;height:100.000000px;position:absolute;border:none;padding:0;margin:0;">&nbsp;</div>
	<div style="background-color:rgba(0%,0%,0%,1);left:43.209877px;top:0.000000px;width:1.234568px;height:100.000000px;position:absolute;border:none;padding:0;margin:0;">&nbsp;</div>
	<div style="background-color:rgba(0%,0%,0%,1);left:45.679012px;top:0.000000px;width:1.234568px;height:100.000000px;position:absolute;border:none;padding:0;margin:0;">&nbsp;</div>
	<div style="background-color:rgba(0%,0%,0%,1);left:48.148148px;top:0.000000px;width:1.234568px;height:100.000000px;position:absolute;border:none;padding:0;margin:0;">&nbsp;</div>
	<div style="background-color:rgba(0%,0%,0%,1);left:50.617284px;top:0.000000px;width:1.234568px;height:100.000000px;position:absolute;border:none;padding:0;margin:0;">&nbsp;</div>
	<div style="background-color:rgba(0%,0%,0%,1);left:53.086420px;top:0.000000px;width:1.234568px;height:100.000000px;position:absolute;border:none;padding:0;margin:0;">&nbsp;</div>
	<div style="background-color:rgba(0%,0%,0%,1);left:55.555556px;top:0.000000px;width:2.469136px;height:100.000000px;position:absolute;border:none;padding:0;margin:0;">&nbsp;</div>
	<div style="background-color:rgba(0%,0%,0%,1);left:60.493827px;top:0.000000px;width:1.234568px;height:100.000000px;position:absolute;border:none;padding:0;margin:0;">&nbsp;</div>
	<div style="background-color:rgba(0%,0%,0%,1);left:62.962963px;top:0.000000px;width:2.469136px;height:100.000000px;position:absolute;border:none;padding:0;margin:0;">&nbsp;</div>
	<div style="background-color:rgba(0%,0%,0%,1);left:67.901235px;top:0.000000px;width:1.234568px;height:100.000000px;position:absolute;border:none;padding:0;margin:0;">&nbsp;</div>
	<div style="background-color:rgba(0%,0%,0%,1);left:70.370370px;top:0.000000px;width:1.234568px;height:100.000000px;position:absolute;border:none;padding:0;margin:0;">&nbsp;</div>
	<div style="background-color:rgba(0%,0%,0%,1);left:72.839506px;top:0.000000px;width:1.234568px;height:100.000000px;position:absolute;border:none;padding:0;margin:0;">&nbsp;</div>
	<div style="background-color:rgba(0%,0%,0%,1);left:75.308642px;top:0.000000px;width:1.234568px;height:100.000000px;position:absolute;border:none;padding:0;margin:0;">&nbsp;</div>
	<div style="background-color:rgba(0%,0%,0%,1);left:77.777778px;top:0.000000px;width:1.234568px;height:100.000000px;position:absolute;border:none;padding:0;margin:0;">&nbsp;</div>
	<div style="background-color:rgba(0%,0%,0%,1);left:80.246914px;top:0.000000px;width:1.234568px;height:100.000000px;position:absolute;border:none;padding:0;margin:0;">&nbsp;</div>
	<div style="background-color:rgba(0%,0%,0%,1);left:83.950617px;top:0.000000px;width:2.469136px;height:100.000000px;position:absolute;border:none;padding:0;margin:0;">&nbsp;</div>
	<div style="background-color:rgba(0%,0%,0%,1);left:87.654321px;top:0.000000px;width:1.234568px;height:100.000000px;position:absolute;border:none;padding:0;margin:0;">&nbsp;</div>
	<div style="background-color:rgba(0%,0%,0%,1);left:90.123457px;top:0.000000px;width:2.469136px;height:100.000000px;position:absolute;border:none;padding:0;margin:0;">&nbsp;</div>
	<div style="background-color:rgba(0%,0%,0%,1);left:95.061728px;top:0.000000px;width:1.234568px;height:100.000000px;position:absolute;border:none;padding:0;margin:0;">&nbsp;</div>
	<div style="background-color:rgba(0%,0%,0%,1);left:98.765432px;top:0.000000px;width:1.234568px;height:100.000000px;position:absolute;border:none;padding:0;margin:0;">&nbsp;</div>
</div>',
    ],
    'UNICODE display format.' => [
      'UNICODE',
      '023130',
      '<pre style="font-family:monospace;line-height:0.61em;font-size:6px;">▄ ▄▄  ▄  ▄ ▄ ▄ ▄  ▄▄ ▄ ▄  ▄ ▄▄ ▄▄  ▄ ▄ ▄ ▄ ▄ ▄▄  ▄ ▄▄  ▄ ▄ ▄ ▄ ▄ ▄  ▄▄ ▄ ▄▄  ▄  ▄
</pre>',
    ],
    'BINARY display format.' => [
      'BINARY',
      '023130',
      '<pre style="font-family:monospace;">101100100101010100110101001011011001010101010110010110010101010101001101011001001
</pre>',
    ],
  ];
}