|
@@ 108-114 (lines=7) @@
|
| 105 |
|
$jsonFlags = JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE | JSON_THROW_ON_ERROR; // phpcs:ignore PHPCompatibility.Constants.NewConstants.json_throw_on_errorFound |
| 106 |
|
|
| 107 |
|
$contents = "# {$this->className} test fixture file\n"; |
| 108 |
|
if ( ! empty( $data['args'] ) ) { |
| 109 |
|
$this->assertIsArray( $data['args'] ); |
| 110 |
|
$contents .= "\n## Constructor args\n"; |
| 111 |
|
$contents .= " ~~~~~~~~json args\n"; |
| 112 |
|
$contents .= $this->indent( json_encode( $data['args'], $jsonFlags ) ) . "\n"; |
| 113 |
|
$contents .= " ~~~~~~~~\n"; |
| 114 |
|
} |
| 115 |
|
if ( isset( $data['changelog'] ) ) { |
| 116 |
|
$this->assertIsString( $data['changelog'] ); |
| 117 |
|
$contents .= "\n## Changelog file\n"; |
|
@@ 122-128 (lines=7) @@
|
| 119 |
|
$contents .= $this->indent( $data['changelog'] ) . "\n"; |
| 120 |
|
$contents .= " ~~~~~~~~\n"; |
| 121 |
|
} |
| 122 |
|
if ( isset( $data['object'] ) ) { |
| 123 |
|
$this->assertInstanceOf( Changelog::class, $data['object'] ); |
| 124 |
|
$contents .= "\n## Changelog object\n"; |
| 125 |
|
$contents .= " ~~~~~~~~json object\n"; |
| 126 |
|
$contents .= $this->indent( json_encode( $data['object'], $jsonFlags ) ) . "\n"; |
| 127 |
|
$contents .= " ~~~~~~~~\n"; |
| 128 |
|
} |
| 129 |
|
if ( isset( $data['changelog'] ) ) { |
| 130 |
|
if ( isset( $data['parse-exception'] ) ) { |
| 131 |
|
$this->assertInstanceOf( Exception::class, $data['parse-exception'] ); |