PHP code example of benconstable / phpspec-laravel
1. Go to this page and download the library: Download benconstable/phpspec-laravel 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/ */
benconstable / phpspec-laravel example snippets
namespace App;
use Inspiring;
class MyInspiring extends Inspiring
{
public function quoteBackwards()
{
return strrev(parent::quote());
}
}
namespace spec\App;
use PhpSpec\ObjectBehavior;
class MyInspiringSpec extends ObjectBehavior
{
function it_inspires_backwards()
{
$this->quoteBackwards()->shouldBeString();
}
}
namespace spec\App;
use PhpSpec\Laravel\LaravelObjectBehavior;
class MyInspiringSpec extends LaravelObjectBehavior
{
function it_inspires_backwards()
{
$this->quoteBackwards()->shouldBeString();
}
}
namespace App;
class MyEncryptor
{
public function encrypt($arg)
{
return bcrypt($arg);
}
}
namespace spec\App;
use PhpSpec\ObjectBehavior;
class MyEncryptor extends ObjectBehavior
{
function it_encrypts_a_string()
{
$this->encrypt()->shouldBeString();
}
}
namespace spec\App;
use PhpSpec\Laravel\LaravelObjectBehavior;
class MyEncryptor extends LaravelObjectBehavior
{
function it_encrypts_a_string()
{
$this->encrypt()->shouldBeString();
}
}