Stevebauman\Location\Tests\LocationTest::test_driver_fallback PHP Méthode

test_driver_fallback() public méthode

    public function test_driver_fallback()
    {
        $fallback = m::mock(Driver::class)->shouldAllowMockingProtectedMethods();
        $fallback->shouldReceive('get')->once()->andReturn(new Fluent());
        $driver = m::mock(Driver::class)->makePartial()->shouldAllowMockingProtectedMethods();
        $driver->shouldReceive('process')->once()->andReturn(false)->shouldReceive('hydrate')->once()->andReturn(new Position());
        $driver->fallback($fallback);
        Location::setDriver($driver);
        $this->assertInstanceOf(Position::class, Location::get());
    }