PHP code example of gourmet / muffin
1. Go to this page and download the library: Download gourmet/muffin 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/ */
gourmet / muffin example snippets
namespace App\Test\Factory;
use Gourmet\Muffin\TestSuite\TestFactory;
class PostFactory extends TestFactory
{
public $title = 'sentence|5'; // a sentence with 5 words
public $body = 'text'; // some text
public $author = 'name'; // a person's name
}
public function setUp()
{
$this->FeedFactory = new \App\Test\Factory\PostFactory();
}
public function testSomething()
{
$post = $this->FeedFactory(1); // create a single record
$this->assertTrue(isset($post->id));
$this->FeedFactory(10); // create 10 records
}