assertNull(Math::getEngine()); $engine = $this->getMock('Bitpay\Math\EngineInterface'); Math::setEngine($engine); $this->assertInstanceOf('Bitpay\Math\EngineInterface', Math::getEngine()); } /** * @requires extension gmp * @runInSeparateProcess */ public function testGmpMath() { if (!extension_loaded('gmp')) { $this->markTestSkipped('The GMP extension is NOT loaded! You must enable it to run this test'); } Math::add("3324234234234234234", "3324234234234234234"); $this->assertEquals(new GmpEngine(), Math::getEngine()); } /** * @requires extension bcmath * @runInSeparateProcess */ public function testBcMath() { if (!extension_loaded('bcmath')) { $this->markTestSkipped('The Bcmath extension is NOT loaded! You must enable it to run this test'); } elseif (extension_loaded('gmp')) { $this->markTestSkipped('The GMP extension is loaded! You must remove it to run this test'); } Math::add("3324234234234234234", "3324234234234234234"); $this->assertEquals(new BcEngine(), Math::getEngine()); } }