Skip to content
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 composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"friendsofphp/php-cs-fixer": "^3.40",
"phpspec/phpspec": "^6.0 || ^7.0",
"phpstan/phpstan": "^2.1.13",
"phpunit/phpunit": "^8.0 || ^9.0 || ^10.0"
"phpunit/phpunit": "^8.0 || ^9.0 || ^10.0 || ^11.0 || ^12.0"
},

"autoload": {
Expand Down
6 changes: 0 additions & 6 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,3 @@ parameters:
identifier: argument.type
count: 1
path: src/Prophecy/Prophecy/MethodProphecy.php

-
message: '#^Cannot access offset mixed on mixed\.$#'
identifier: offsetAccess.nonOffsetAccessible
count: 1
path: src/Prophecy/Util/ExportUtil.php
4 changes: 0 additions & 4 deletions src/Prophecy/Util/ExportUtil.php
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,6 @@ protected static function recursiveExport(&$value, $indentation, $processed = nu
return 'Array &'.$key;
}

\assert(\is_array($value));
$array = $value;
$key = $processed->add($value);
$values = '';
Expand All @@ -172,11 +171,9 @@ protected static function recursiveExport(&$value, $indentation, $processed = nu
$class = get_class($value);

if ($processed->contains($value)) {
\assert(\is_object($value));
return sprintf('%s#%d Object', $class, spl_object_id($value));
}

\assert(\is_object($value));
$processed->add($value);
$values = '';
$array = self::toArray($value);
Expand All @@ -193,7 +190,6 @@ protected static function recursiveExport(&$value, $indentation, $processed = nu

$values = "\n".$values.$whitespace;
}
\assert(\is_object($value));

return sprintf('%s#%d Object (%s)', $class, spl_object_id($value), $values);
}
Expand Down
8 changes: 8 additions & 0 deletions tests/Argument/Token/ExactValueTokenTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace Tests\Prophecy\Argument\Token;

use PHPUnit\Framework\Attributes\Test;
use PHPUnit\Framework\TestCase;
use Prophecy\Argument\Token\ExactValueToken;

Expand All @@ -12,6 +13,7 @@ class ExactValueTokenTest extends TestCase
* @see https://github.com/phpspec/prophecy/issues/268
* @see https://stackoverflow.com/a/19097159/2424814
*/
#[Test]
public function does_not_trigger_nesting_error()
{
$child1 = new ChildClass('A', new ParentClass());
Expand All @@ -24,6 +26,7 @@ public function does_not_trigger_nesting_error()
/**
* @test
*/
#[Test]
public function scores_10_for_objects_with_same_fields()
{
$child1 = new ChildClass('A', new ParentClass());
Expand All @@ -36,6 +39,7 @@ public function scores_10_for_objects_with_same_fields()
/**
* @test
*/
#[Test]
public function scores_10_for_matching_callables()
{
$callable = function () {};
Expand All @@ -47,6 +51,7 @@ public function scores_10_for_matching_callables()
/**
* @test
*/
#[Test]
public function scores_false_for_object_and_string()
{
$child1 = new ChildClass('A', new ParentClass());
Expand All @@ -58,6 +63,7 @@ public function scores_false_for_object_and_string()
/**
* @test
*/
#[Test]
public function scores_false_for_object_and_int()
{
$child1 = new ChildClass('A', new ParentClass());
Expand All @@ -69,6 +75,7 @@ public function scores_false_for_object_and_int()
/**
* @test
*/
#[Test]
public function scores_false_for_object_and_stdclass()
{
$child1 = new ChildClass('A', new ParentClass());
Expand All @@ -80,6 +87,7 @@ public function scores_false_for_object_and_stdclass()
/**
* @test
*/
#[Test]
public function scores_false_for_object_and_null()
{
$child1 = new ChildClass('A', new ParentClass());
Expand Down
2 changes: 2 additions & 0 deletions tests/Comparator/FactoryProviderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace Tests\Prophecy\Comparator;

use PHPUnit\Framework\Attributes\Test;
use Prophecy\Comparator\ClosureComparator;
use Prophecy\Comparator\FactoryProvider;
use PHPUnit\Framework\TestCase;
Expand All @@ -11,6 +12,7 @@ class FactoryProviderTest extends TestCase
/**
* @test
*/
#[Test]
function it_should_have_ClosureComparator_registered()
{
$comparator = FactoryProvider::getInstance()->getComparatorFor(function () {}, function () {});
Expand Down
3 changes: 3 additions & 0 deletions tests/Doubler/ClassPatch/MagicCallPatchTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace Tests\Prophecy\Doubler\ClassPatch;

use PHPUnit\Framework\Attributes\Test;
use PHPUnit\Framework\TestCase;
use Prophecy\Doubler\ClassPatch\MagicCallPatch;
use Prophecy\Doubler\Generator\ClassMirror;
Expand All @@ -13,6 +14,7 @@ class MagicCallPatchTest extends TestCase
/**
* @test
*/
#[Test]
public function it_supports_classes_with_invalid_tags()
{
$class = new \ReflectionClass('Fixtures\Prophecy\WithPhpdocClass');
Expand All @@ -32,6 +34,7 @@ public function it_supports_classes_with_invalid_tags()
/**
* @test
*/
#[Test]
public function it_supports_arguments_for_magic_methods()
{
$class = new \ReflectionClass('Fixtures\Prophecy\WithPhpdocClass');
Expand Down
Loading