Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Use methods instead of deprecated magic properties #591

Merged
merged 1 commit into from
Dec 29, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion test/Unit/Exception/InvalidIndentStringExceptionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public function testDefaults(): void

public function testFromSizeAndMinimumSizeReturnsInvalidIndentStringException(): void
{
$string = self::faker()->word;
$string = self::faker()->word();

$exception = Exception\InvalidIndentStringException::fromString($string);

Expand Down
4 changes: 2 additions & 2 deletions test/Unit/Exception/InvalidIndentStyleExceptionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ public function testFromStyleAndAllowedStylesReturnsInvalidIndentStyleException(
{
$faker = self::faker();

$style = $faker->word;
$style = $faker->word();

/** @var string[] $allowedStyles */
$allowedStyles = $faker->words;
$allowedStyles = $faker->words();

$exception = Exception\InvalidIndentStyleException::fromStyleAndAllowedStyles(
$style,
Expand Down
2 changes: 1 addition & 1 deletion test/Unit/Exception/InvalidJsonEncodedExceptionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public function testDefaults(): void

public function testFromEncodedReturnsInvalidJsonEncodedException(): void
{
$encoded = self::faker()->sentence;
$encoded = self::faker()->sentence();

$exception = Exception\InvalidJsonEncodedException::fromEncoded($encoded);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public function testDefaults(): void

public function testFromSizeAndMinimumSizeReturnsInvalidIndentStringException(): void
{
$string = self::faker()->word;
$string = self::faker()->word();

$exception = Exception\InvalidNewLineStringException::fromString($string);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,12 @@ public function testFromSchemaUriReturnsNormalizedInvalidAccordingToSchemaExcept
{
$faker = self::faker();

$schemaUri = $faker->url;
$schemaUri = $faker->url();

$errors = [
$faker->sentence,
$faker->sentence,
$faker->sentence,
$faker->sentence(),
$faker->sentence(),
$faker->sentence(),
];

$exception = Exception\NormalizedInvalidAccordingToSchemaException::fromSchemaUriAndErrors(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,12 @@ public function testFromSchemaUriAndErrorsReturnsOriginalInvalidAccordingToSchem
{
$faker = self::faker();

$schemaUri = $faker->url;
$schemaUri = $faker->url();

$errors = [
$faker->sentence,
$faker->sentence,
$faker->sentence,
$faker->sentence(),
$faker->sentence(),
$faker->sentence(),
];

$exception = Exception\OriginalInvalidAccordingToSchemaException::fromSchemaUriAndErrors(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public function testDefaults(): void

public function testFromSchemaUriReturnsSchemaUriCouldNotBeReadException(): void
{
$schemaUri = self::faker()->url;
$schemaUri = self::faker()->url();

$exception = Exception\SchemaUriCouldNotBeReadException::fromSchemaUri($schemaUri);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public function testDefaults(): void

public function testFromSchemaUriReturnsSchemaUriCouldNotBeResolvedException(): void
{
$schemaUri = self::faker()->url;
$schemaUri = self::faker()->url();

$exception = Exception\SchemaUriCouldNotBeResolvedException::fromSchemaUri($schemaUri);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public function testDefaults(): void

public function testFromSchemaUriReturnsSchemaUriReferencesDocumentWithInvalidMediaType(): void
{
$schemaUri = self::faker()->url;
$schemaUri = self::faker()->url();

$exception = Exception\SchemaUriReferencesDocumentWithInvalidMediaTypeException::fromSchemaUri($schemaUri);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public function testDefaults(): void

public function testFromSchemaUriReturnsSchemaUriReferencesDocumentWithInvalidMediaType(): void
{
$schemaUri = self::faker()->url;
$schemaUri = self::faker()->url();

$exception = Exception\SchemaUriReferencesInvalidJsonDocumentException::fromSchemaUri($schemaUri);

Expand Down
2 changes: 1 addition & 1 deletion test/Unit/FixedFormatNormalizerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public function testNormalizeNormalizesAndFormatsUsingFormat(): void
Format\JsonEncodeOptions::fromInt($faker->numberBetween(1)),
Format\Indent::fromString("\t"),
Format\NewLine::fromString("\r\n"),
$faker->boolean,
$faker->boolean(),
);

$json = Json::fromEncoded(
Expand Down
4 changes: 2 additions & 2 deletions test/Unit/Format/IndentTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public function testFromSizeAndStyleRejectsInvalidStyle(): void
$faker = self::faker();

$size = $faker->numberBetween(1);
$style = $faker->sentence;
$style = $faker->sentence();

$this->expectException(Exception\InvalidIndentStyleException::class);

Expand Down Expand Up @@ -141,7 +141,7 @@ public function testFromStringRejectsInvalidIndentString(string $string): void
public function provideInvalidIndentString(): \Generator
{
$strings = [
'string-not-whitespace' => self::faker()->sentence,
'string-not-whitespace' => self::faker()->sentence(),
'string-contains-line-feed' => " \n ",
'string-mixed-space-and-tab' => " \t",
];
Expand Down
18 changes: 9 additions & 9 deletions test/Unit/SchemaNormalizerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public function testNormalizeThrowsSchemaUriCouldNotBeResolvedExceptionWhenSchem
JSON
);

$schemaUri = self::faker()->url;
$schemaUri = self::faker()->url();

$schemaStorage = $this->createMock(SchemaStorage::class);

Expand Down Expand Up @@ -86,7 +86,7 @@ public function testNormalizeThrowsSchemaUriCouldNotBeReadExceptionWhenSchemaUri
JSON
);

$schemaUri = self::faker()->url;
$schemaUri = self::faker()->url();

$schemaStorage = $this->createMock(SchemaStorage::class);

Expand Down Expand Up @@ -118,7 +118,7 @@ public function testNormalizeThrowsSchemaUriReferencesDocumentWithInvalidMediaTy
JSON
);

$schemaUri = self::faker()->url;
$schemaUri = self::faker()->url();

$schemaStorage = $this->createMock(SchemaStorage::class);

Expand Down Expand Up @@ -150,7 +150,7 @@ public function testNormalizeThrowsRuntimeExceptionIfSchemaUriReferencesResource
JSON
);

$schemaUri = self::faker()->url;
$schemaUri = self::faker()->url();

$schemaStorage = $this->createMock(SchemaStorage::class);

Expand Down Expand Up @@ -184,7 +184,7 @@ public function testNormalizeThrowsOriginalInvalidAccordingToSchemaExceptionWhen
JSON
);

$schemaUri = $faker->url;
$schemaUri = $faker->url();

$schema = <<<'JSON'
{
Expand Down Expand Up @@ -212,9 +212,9 @@ public function testNormalizeThrowsOriginalInvalidAccordingToSchemaExceptionWhen
self::identicalTo($schemaDecoded),
)
->willReturn(Result::create(
$faker->sentence,
$faker->sentence,
$faker->sentence,
$faker->sentence(),
$faker->sentence(),
$faker->sentence(),
));

$normalizer = new SchemaNormalizer(
Expand All @@ -241,7 +241,7 @@ public function testNormalizeThrowsNormalizedInvalidAccordingToSchemaExceptionWh
JSON
);

$schemaUri = $faker->url;
$schemaUri = $faker->url();

$schema = <<<'JSON'
{
Expand Down
6 changes: 3 additions & 3 deletions test/Unit/Validator/ResultTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ public function testCreateReturnsResultWithErrors(): void
$faker = self::faker();

$errors = [
$faker->sentence,
$faker->sentence,
$faker->sentence,
$faker->sentence(),
$faker->sentence(),
$faker->sentence(),
];

$result = Validator\Result::create(...$errors);
Expand Down
4 changes: 2 additions & 2 deletions test/Unit/Vendor/Composer/AbstractComposerTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,13 @@ final public function provideJsonNotDecodingToObject(): \Generator
$faker = self::faker();

$values = [
'array' => $faker->words,
'array' => $faker->words(),
'bool-false' => false,
'bool-true' => true,
'float' => $faker->randomFloat(),
'int' => $faker->randomNumber(),
'null' => null,
'string' => $faker->sentence,
'string' => $faker->sentence(),
];

foreach ($values as $key => $value) {
Expand Down