2014-08-31 14:13:46 +02:00
|
|
|
<?php
|
|
|
|
|
2014-08-31 14:24:10 +02:00
|
|
|
namespace Brick\Math\Tests;
|
2014-08-31 14:13:46 +02:00
|
|
|
|
|
|
|
use Brick\Math\Internal\Calculator;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Tests for Calculator implementation detection.
|
|
|
|
*/
|
|
|
|
class CalculatorDetectTest extends \PHPUnit_Framework_TestCase
|
|
|
|
{
|
|
|
|
public function testGetWithNoCalculatorSetDetectsCalculator()
|
|
|
|
{
|
2015-05-22 13:39:59 +02:00
|
|
|
$currentCalculator = Calculator::get();
|
|
|
|
|
2014-08-31 14:13:46 +02:00
|
|
|
Calculator::set(null);
|
|
|
|
$this->assertInstanceOf(Calculator::class, Calculator::get());
|
2015-05-22 13:39:59 +02:00
|
|
|
|
|
|
|
Calculator::set($currentCalculator);
|
2014-08-31 14:13:46 +02:00
|
|
|
}
|
|
|
|
}
|