1. Go to this page and download the library: Download mahmoudz/fyber-php-sdk library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
// create real instance from Fyber
$fyber = new Fyber();
// create another instance of Fyber and mock it
$fyberMock = Mockery::mock(Fyber::class);
// now let the function getOffers call the getOffersMock instead
$fyberMock->shouldReceive('getOffers')->once()->andReturn($fyber->getOffersMock([], ''));
// create real instance from Fyber
$fyber = App::make(Fyber::class);
// create another instance of Fyber and mock it
$fyberToMock = App::make(Fyber::class);
$fyberMock = Mockery::mock(fyberToMock);
App::instance(fyberToMock, $fyberMock);
// now let the function getOffers call the getOffersMock instead
$fyberMock->shouldReceive('getOffers')->once()->andReturn($fyber->getOffersMock([], ''));