How do I assert the result is an integer in PHPUnit?
$this->assertInternalType("int", $id);
Edit: As of PHPUnit 8, the answer is:
$this->assertIsInt($id);
I prefer using the official PHPUnit class constants.
PHPUnit v5.2:
use PHPUnit_Framework_Constraint_IsType as PHPUnit_IsType;
// ...
$this->assertInternalType(PHPUnit_IsType::TYPE_INT, $new_id);
Or latest which at the moment of writing is v7.0:
use PHPUnit\Framework\Constraint\IsType;
// ...
$this->assertInternalType(IsType::TYPE_INT, $new_id);