You are here

public static function PHPUnit_Util_InvalidArgumentHelper::factory in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/phpunit/phpunit/src/Util/InvalidArgumentHelper.php \PHPUnit_Util_InvalidArgumentHelper::factory()

Parameters

int $argument:

string $type:

mixed $value:

Return value

PHPUnit_Framework_Exception

73 calls to PHPUnit_Util_InvalidArgumentHelper::factory()
PHPUnit_Extensions_PhptTestCase::__construct in vendor/phpunit/phpunit/src/Extensions/PhptTestCase.php
Constructs a test case with the given filename.
PHPUnit_Extensions_PhptTestSuite::__construct in vendor/phpunit/phpunit/src/Extensions/PhptTestSuite.php
Constructs a new TestSuite for .phpt test cases.
PHPUnit_Extensions_RepeatedTest::__construct in vendor/phpunit/phpunit/src/Extensions/RepeatedTest.php
PHPUnit_Framework_Assert::assertArrayHasKey in vendor/phpunit/phpunit/src/Framework/Assert.php
Asserts that an array has a specified key.
PHPUnit_Framework_Assert::assertArrayNotHasKey in vendor/phpunit/phpunit/src/Framework/Assert.php
Asserts that an array does not have a specified key.

... See full list

File

vendor/phpunit/phpunit/src/Util/InvalidArgumentHelper.php, line 25

Class

PHPUnit_Util_InvalidArgumentHelper
Factory for PHPUnit_Framework_Exception objects that are used to describe invalid arguments passed to a function or method.

Code

public static function factory($argument, $type, $value = null) {
  $stack = debug_backtrace(false);
  return new PHPUnit_Framework_Exception(sprintf('Argument #%d%sof %s::%s() must be a %s', $argument, $value !== null ? ' (' . gettype($value) . '#' . $value . ')' : ' (No Value) ', $stack[1]['class'], $stack[1]['function'], $type));
}