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

[PhpUnitBridge] Add assertIsX methods in ForwardCompatTestTrait #32848

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
110 changes: 110 additions & 0 deletions src/Symfony/Bridge/PhpUnit/Legacy/ForwardCompatTestTraitForV5.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,4 +79,114 @@ private function doTearDown()
{
parent::tearDown();
}

/**
* @param string $message
*
* @return void
*/
public static function assertIsArray($actual, $message = '')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
public static function assertIsArray($actual, $message = '')
public static function assertIsArray($actual, string $message = '')

should be no problem, right?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not compatible with php 5. The bridge don't use the same version of PHP.

"require": {
"php": ">=5.5.9 EVEN ON LATEST SYMFONY VERSIONS TO ALLOW USING",
"php": "THIS BRIDGE WHEN TESTING LOWEST SYMFONY VERSIONS.",
"php": ">=5.5.9"
},

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

{
static::assertInternalType('array', $actual, $message);
}

/**
* @param string $message
*
* @return void
*/
public static function assertIsBool($actual, $message = '')
{
static::assertInternalType('bool', $actual, $message);
}

/**
* @param string $message
*
* @return void
*/
public static function assertIsFloat($actual, $message = '')
{
static::assertInternalType('float', $actual, $message);
}

/**
* @param string $message
*
* @return void
*/
public static function assertIsInt($actual, $message = '')
{
static::assertInternalType('int', $actual, $message);
}

/**
* @param string $message
*
* @return void
*/
public static function assertIsNumeric($actual, $message = '')
{
static::assertInternalType('numeric', $actual, $message);
}

/**
* @param string $message
*
* @return void
*/
public static function assertIsObject($actual, $message = '')
{
static::assertInternalType('object', $actual, $message);
}

/**
* @param string $message
*
* @return void
*/
public static function assertIsResource($actual, $message = '')
{
static::assertInternalType('resource', $actual, $message);
}

/**
* @param string $message
*
* @return void
*/
public static function assertIsString($actual, $message = '')
{
static::assertInternalType('string', $actual, $message);
}

/**
* @param string $message
*
* @return void
*/
public static function assertIsScalar($actual, $message = '')
{
static::assertInternalType('scalar', $actual, $message);
}

/**
* @param string $message
*
* @return void
*/
public static function assertIsCallable($actual, $message = '')
{
static::assertInternalType('callable', $actual, $message);
}

/**
* @param string $message
*
* @return void
*/
public static function assertIsIterable($actual, $message = '')
{
static::assertInternalType('iterable', $actual, $message);
}
}