1. Go to this page and download the library: Download nunomaduro/laravel-mojito 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/ */
nunomaduro / laravel-mojito example snippets
class WelcomeTest extends TestCase
{
// First, add the `InteractsWithViews` trait to your test case class.
use InteractsWithViews;
public function testDisplaysLaravel()
{
// Then, get started with Mojito using the `assertView` method.
$this->assertView('welcome')->contains('Laravel');
}
}
class WelcomeTest extends TestCase
{
public function testDisplaysLaravel()
{
$response = $this->get('/');
$response->assertStatus(200);
$response->assertView()->contains('Laravel');
}
}
use NunoMaduro\LaravelMojito\ViewAssertion;
// Within a service provider:
ViewAssertion::macro('hasCharset', function (string $charset) {
return $this->in('head')->first('meta')->hasAttribute('charset', $charset);
});
// In your tests:
$this->assertView('welcome')->hasCharset('utf-8');
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.