How do I assert the result is an integer in PHPUnit? March 6, 2023 by Tarik $this->assertInternalType("int", $id); Edit: As of PHPUnit 8, the answer is: $this->assertIsInt($id);