1. Go to this page and download the library: Download viraj/cakephp-integrated 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/ */
viraj / cakephp-integrated example snippets
protected $baseUrl = 'http://your-dev-url';
class DemoTest extends CakeTestCase
{
}
class DemoTest extends LegacyTestCase
{
}
class DemoTest extends CakeTestCase
{
use DatabaseMigrations;
protected $baseUrl = "http://local.yourapp.dev";
/** @test */
public function unauthenticated_user_cannot_see_the_add_posts_page()
{
$this->openPage('/posts/add')
->canSeePageUrlContains('/users/login');
}
/** @test */
public function authenticated_user_can_add_a_new_post()
{
$user = factory('Users')->create();
$this->actingAs($user)
->openPage('/posts/add')
->fillInField('title', 'My first post')
->fillInField('author', 'Viraj Khatavkar')
->fillInField('body', 'My Post body')
->check('published')
->press('Submit')
->canSeePageIs('/posts')
->seeText('My first post');
}
}