Skip to content

Commit

Permalink
remove nonobject provider
Browse files Browse the repository at this point in the history
  • Loading branch information
OskarStark committed Dec 17, 2019
1 parent a30b8c6 commit e1735f8
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 66 deletions.
10 changes: 1 addition & 9 deletions src/Dont/Exception/NonStringableObject.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,10 @@ class NonStringableObject extends LogicException implements ExceptionInterface
ERROR;

/**
* @param object $object
*
* @return NonStringableObject
*
* @throws TypeError
*/
public static function fromAttemptedToString($object) : self
public static function fromAttemptedToString(object $object) : self
{
if (! is_object($object)) {
throw TypeError::fromNonObject($object);
}

$className = get_class($object);

return new self(sprintf(
Expand Down
29 changes: 0 additions & 29 deletions tests/DontTest/Exception/NonCallableObjectTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,33 +47,4 @@ public function objectProvider() : array
[$this],
];
}

/**
* @dataProvider nonObjectProvider
*
* @param mixed $nonObject
*/
public function testWillThrowOnNonObject($nonObject) : void
{
$this->expectException(TypeError::class);

NonCallableObject::fromAttemptedCall($nonObject, 'propertyName');
}

/**
* @return mixed[][]
*/
public function nonObjectProvider() : array
{
return [
[null],
[true],
[123],
[12.3],
['foo'],
[[]],
[STDERR],
];
}

}
28 changes: 0 additions & 28 deletions tests/DontTest/Exception/NonStringableObjectTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,32 +47,4 @@ public function objectProvider() : array
[$this],
];
}

/**
* @dataProvider nonObjectProvider
*
* @param mixed $nonObject
*/
public function testWillThrowOnNonObject($nonObject) : void
{
$this->expectException(TypeError::class);

NonStringableObject::fromAttemptedToString($nonObject);
}

/**
* @return mixed[][]
*/
public function nonObjectProvider() : array
{
return [
[null],
[true],
[123],
[12.3],
['foo'],
[[]],
[STDERR],
];
}
}

0 comments on commit e1735f8

Please sign in to comment.