# Documentation

Menu

## QRMatrixTest extends TestCase
in package
uses QRMatrixDebugTrait

FinalYes
QRMatrixTest.php : 25

Tests the QRMatrix class

### Table of Contents

#### Constants

version = 40

#### Properties

$matrix : QRMatrix

#### Methods

matrixProvider() : Generator
  Version data provider for several pattern tests
testCheckNeighbours() : void
  Tests checking the adjacent modules
testCheckTypeIn() : void
  Tests checking whether the M_TYPE of a module is not one of an array of M_TYPES
testFlip() : void
  Tests flipping the value of a module
testGetECC() : void
  Tests if eccLevel() returns the current (given) ECC level
testGetMaskPattern() : void
  Tests if maskPattern() returns the current (or default) mask pattern
testGetSetCheck() : void
  Tests the set(), get() and check() methods
testGetSize() : void
  Tests if size() returns the actual matrix size/count
testGetVersion() : void
  Tests if version() returns the current (given) version
testRotate90() : void
  Tests rotating the matrix by 90 degrees CW
testSetAlignmentPattern() : void
  Tests the alignment patterns and verifies their positions - version 1 (no pattern) skipped
testSetDarkModule() : void
  Tests setting the dark module and verifies its position
testSetFinderPattern() : void
  Tests setting the finder patterns and verifies their positions
testSetFormatInfo() : void
  Tests the format patterns and verifies their positions
testSetLogoSpaceExceedsException() : void
  Tests whether an exception is thrown when width or height exceed the matrix size
testSetLogoSpaceInvalidEccException() : void
  Tests whether an exception is thrown when an ECC level other than "H" is set when attempting to add logo space
testSetLogoSpaceMaxSizeException() : void
  Tests whether an exception is thrown when the logo space size exceeds the maximum ECC capacity
testSetLogoSpaceOmitDimension() : void
  Tests if the logo space is drawn square if one of the dimensions is omitted
testSetLogoSpaceOrientation() : void
  Tests the auto orientation of the logo space
testSetLogoSpacePosition() : void
  Tests the manual positioning of the logo space
testSetQuietZone() : void
  Tests the quiet zone pattern and verifies its position
testSetQuietZoneException() : void
  Tests if an exception is thrown in an attempt to create the quiet zone before data was written
testSetSeparators() : void
  Tests the separator patterns and verifies their positions
testSetTimingPattern() : void
  Tests the timing patterns and verifies their positions
testSetVersionNumber() : void
  Tests the version patterns and verifies their positions - version < 7 skipped
debugMatrix() : void
  Matrix debugging console output
dm() : void
  debugging shortcut - limit to a single version when using with matrixProvider
setUp() : void
  invokes a QRMatrix object

### Constants

#### version

QRMatrixTest.php : 28
`private mixed version = 40`

### Properties

#### $matrix

QRMatrixTest.php : 29
`private QRMatrix $matrix`

### Methods

#### matrixProvider()

QRMatrixTest.php : 100

Version data provider for several pattern tests

`public static matrixProvider() : Generator`

##### Return values

Generator

#### testCheckNeighbours()

QRMatrixTest.php : 465

Tests checking the adjacent modules

`public testCheckNeighbours() : void`

#### testCheckTypeIn()

QRMatrixTest.php : 455

Tests checking whether the M_TYPE of a module is not one of an array of M_TYPES

`public testCheckTypeIn() : void`

#### testFlip()

QRMatrixTest.php : 435

Tests flipping the value of a module

`public testFlip() : void`

#### testGetECC()

QRMatrixTest.php : 58

Tests if eccLevel() returns the current (given) ECC level

`public testGetECC() : void`

#### testGetMaskPattern()

QRMatrixTest.php : 65

Tests if maskPattern() returns the current (or default) mask pattern

`public testGetMaskPattern() : void`

#### testGetSetCheck()

QRMatrixTest.php : 76

Tests the set(), get() and check() methods

`public testGetSetCheck() : void`

#### testGetSize()

QRMatrixTest.php : 44

Tests if size() returns the actual matrix size/count

`public testGetSize() : void`

#### testGetVersion()

QRMatrixTest.php : 51

Tests if version() returns the current (given) version

`public testGetVersion() : void`

#### testRotate90()

QRMatrixTest.php : 287

Tests rotating the matrix by 90 degrees CW

`public testRotate90(QRMatrix $matrix) : void`

##### Parameters

$matrix : QRMatrix

##### Attributes

#[DataProvider]
  'matrixProvider'

#### testSetAlignmentPattern()

QRMatrixTest.php : 152

Tests the alignment patterns and verifies their positions - version 1 (no pattern) skipped

`public testSetAlignmentPattern(QRMatrix $matrix) : void`

##### Parameters

$matrix : QRMatrix

##### Attributes

#[DataProvider]
  'matrixProvider'

#### testSetDarkModule()

QRMatrixTest.php : 111

Tests setting the dark module and verifies its position

`public testSetDarkModule(QRMatrix $matrix) : void`

##### Parameters

$matrix : QRMatrix

##### Attributes

#[DataProvider]
  'matrixProvider'

#### testSetFinderPattern()

QRMatrixTest.php : 123

Tests setting the finder patterns and verifies their positions

`public testSetFinderPattern(QRMatrix $matrix) : void`

##### Parameters

$matrix : QRMatrix

##### Attributes

#[DataProvider]
  'matrixProvider'

#### testSetFormatInfo()

QRMatrixTest.php : 231

Tests the format patterns and verifies their positions

`public testSetFormatInfo(QRMatrix $matrix) : void`

##### Parameters

$matrix : QRMatrix

##### Attributes

#[DataProvider]
  'matrixProvider'

#### testSetLogoSpaceExceedsException()

QRMatrixTest.php : 407

Tests whether an exception is thrown when width or height exceed the matrix size

`public testSetLogoSpaceExceedsException() : void`

#### testSetLogoSpaceInvalidEccException()

QRMatrixTest.php : 397

Tests whether an exception is thrown when an ECC level other than "H" is set when attempting to add logo space

`public testSetLogoSpaceInvalidEccException() : void`

#### testSetLogoSpaceMaxSizeException()

QRMatrixTest.php : 421

Tests whether an exception is thrown when the logo space size exceeds the maximum ECC capacity

`public testSetLogoSpaceMaxSizeException() : void`

#### testSetLogoSpaceOmitDimension()

QRMatrixTest.php : 323

Tests if the logo space is drawn square if one of the dimensions is omitted

`public testSetLogoSpaceOmitDimension() : void`

#### testSetLogoSpaceOrientation()

QRMatrixTest.php : 345

Tests the auto orientation of the logo space

`public testSetLogoSpaceOrientation() : void`

#### testSetLogoSpacePosition()

QRMatrixTest.php : 369

Tests the manual positioning of the logo space

`public testSetLogoSpacePosition() : void`

#### testSetQuietZone()

QRMatrixTest.php : 246

Tests the quiet zone pattern and verifies its position

`public testSetQuietZone(QRMatrix $matrix) : void`

##### Parameters

$matrix : QRMatrix

##### Attributes

#[DataProvider]
  'matrixProvider'

#### testSetQuietZoneException()

QRMatrixTest.php : 277

Tests if an exception is thrown in an attempt to create the quiet zone before data was written

`public testSetQuietZoneException() : void`

#### testSetSeparators()

QRMatrixTest.php : 137

Tests the separator patterns and verifies their positions

`public testSetSeparators(QRMatrix $matrix) : void`

##### Parameters

$matrix : QRMatrix

##### Attributes

#[DataProvider]
  'matrixProvider'

#### testSetTimingPattern()

QRMatrixTest.php : 183

Tests the timing patterns and verifies their positions

`public testSetTimingPattern(QRMatrix $matrix) : void`

##### Parameters

$matrix : QRMatrix

##### Attributes

#[DataProvider]
  'matrixProvider'

#### testSetVersionNumber()

QRMatrixTest.php : 211

Tests the version patterns and verifies their positions - version < 7 skipped

`public testSetVersionNumber(QRMatrix $matrix) : void`

##### Parameters

$matrix : QRMatrix

##### Attributes

#[DataProvider]
  'matrixProvider'

#### debugMatrix()

QRMatrixDebugTrait.php : 27

Matrix debugging console output

`protected debugMatrix(QRMatrix $matrix) : void`

##### Parameters

$matrix : QRMatrix

#### dm()

QRMatrixDebugTrait.php : 84

debugging shortcut - limit to a single version when using with matrixProvider

`protected dm(QRMatrix $matrix) : void`

##### Parameters

$matrix : QRMatrix

##### Tags

see
  QRMatrixTest::matrixProvider()

#### setUp()

QRMatrixTest.php : 34

invokes a QRMatrix object

`protected setUp() : void`

## Search results