PHPUnit assertIsNotObject() Function Last Updated : 07 Aug, 2020 Comments Improve Suggest changes Like Article Like Report The assertIsNotObject() function is a builtin function in PHPUnit and is used to assert whether the actual given content does not object. This assertion will return true in the case if the actual given content is not object else returns false. In case of true the asserted test case got passed else test case got failed. Syntax: assertIsNotObject($actual[, $message = '']) Parameters: This function accepts two parameters as mentioned above and described below: $actual: This parameter is of any type which represents the actual content. $message: This parameter takes a string value. When the test case got failed this string message got displayed as an error message. Below examples illustrate the assertIsNotObject() function in PHPUnit: Example 1: PHP <?php use PHPUnit\Framework\TestCase; class GeeksPhpunitTestCase extends TestCase { public function testNegativeTestcaseForassertIsNotObject() { $actualcontent = (object) ('lovely laptop'); // Assert function to test whether given // actual content is not object $this->assertIsNotObject( $actualcontent, "actual content is not object" ); } } ?> Output: PHPUnit 8.5.8 by Sebastian Bergmann and contributors. F 1 / 1 (100%) Time: 88 ms, Memory: 10.00 MB There was 1 failure: 1) GeeksPhpunitTestCase::testNegativeTestcaseForassertIsNotObject actual content is not object Failed asserting that stdClass Object &00000000469abe610000000023d4ee24 ( 'scalar' => 'lovely laptop' ) is not of type "object". /home/lovely/Documents/php/test.php:15 FAILURES! Tests: 1, Assertions: 1, Failures: 1. Example 2: PHP <?php use PHPUnit\Framework\TestCase; class GeeksPhpunitTestCase extends TestCase { public function testPositiveTestcaseForassertIsNotObject() { $actualcontent = ('lovely laptop'); // Assert function to test whether given // actual content is not object $this->assertIsNotObject( $actualcontent, "actual content is not object" ); } } ?> Output: PHPUnit 8.5.8 by Sebastian Bergmann and contributors. . 1 / 1 (100%) Time: 86 ms, Memory: 10.00 MB OK (1 test, 1 assertion) Comment More infoAdvertise with us Next Article PHPUnit assertIsNotObject() Function S shubham_singh Follow Improve Article Tags : Web Technologies PHP PHP-PHPUnit Similar Reads PHPUnit assertIsObject() Function The assertIsObject() function is a builtin function in PHPUnit and is used to assert whether the actual given content is an object or not. This assertion will return true in the case if the actual given content is object else returns false. In case of true the asserted test case got passed, else tes 2 min read PHPUnit assertIsNotFloat() Function The assertIsNotFloat() function is a builtin function in PHPUnit and is used to assert whether the actually obtained value is not a float. This assertion will return true in the case if the actual value is doesn't Float else returns false. In case of true the asserted test case got passed else test 2 min read PHPUnit assertIsNotInt() Function The assertIsNotInt() function is a builtin function in PHPUnit and is used to assert whether the given actual variable is not an integer. This assertion will return true in the case if the actual variable is doesn't integer else returns false. In case of true the asserted test case got passed else t 2 min read PHPUnit assertIsNotBool() Function The assertIsNotBool() function is a builtin function in PHPUnit and is used to assert whether the actually obtained value is Not a Bool. This assertion will return true in the case if the actual value is the Not a Bool else returns false. In case of true the asserted test case got passed else test c 2 min read PHPUnit assertIsNotNumeric() Function The assertIsNotNumeric() function is a built-in function in PHPUnit and is used to assert whether a given actual variable is doesn't numeric. This assertion will return true in the case if the actual variable doesn't numeric else returns false. In the case of true the asserted test case got passed e 2 min read PHPUnit assertIsInt() Function The assertIsInt() function is a builtin function in PHPUnit and is used to assert whether the given actual variable is an integer or not. This assertion will return true in the case if the actual variable is an integer else returns false. In case of true the asserted test case got passed else test c 2 min read PHPUnit assertIsNotResource() Function The assertIsNotResource() function is a builtin function in PHPUnit and is used to assert whether the given variable is not Resource. This assertion will return true in the case if the given variable is not Resource else returns false. In case of true the asserted test case got passed else test case 2 min read PHPUnit assertFinite() Function The assertFinite() function is a builtin function in PHPUnit and is used to assert whether the actually obtained value is not INF. This assertion will return true in the case if the actual value is not INF else returns false. In case of true the asserted test case got passed else test case got faile 2 min read PHPUnit assertIsBool() Function The assertIsBool() function is a builtin function in PHPUnit and is used to assert whether the actually obtained value is Bool or not. This assertion will return true in the case if the actual value is the Bool else returns false. In case of true the asserted test case got passed else test case got 2 min read Like