1. Go to this page and download the library: Download andreasindal/limerence 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/ */
andreasindal / limerence example snippets
namespace App\Animals;
class Dog
{
public function makeSound()
{
return "Woof woof!";
}
}
use App\Animals\Dog;
test('Dog model test', function () {
describe('function makeSound()', function () {
it('should make a barking sound', function () {
$dog = new Dog();
expect($dog)->to->have->method('makeSound');
$bark = $dog->makeSound();
expect($bark)->to->be->a('string');
expect($bark)->to->equal('Woof woof!');
});
});
});
post('/users')
->expect(201)
->send([
'username' => 'johnny',
'email' => '[email protected]',
'password' => 'password123',
]) // no json flag, data will be sent as normal form data
->end(function ($err, $res) {
// ...
});
put('/users/15')
->expect(200)
->send([
'firstname' => 'James',
'lastname' => 'Smith',
], true) // Data will be sent as JSON
->end(function ($err, $res) {
// ...
});