Skip to content

Instantly share code, notes, and snippets.

@laracasts
laracasts / StatusRepository.php
Last active May 19, 2018
Integration Testing Repositories That Use Eloquent (with Codeception)
View StatusRepository.php
<?php namespace Larabook\Statuses;
use Larabook\Users\User;
class StatusRepository {
/**
* Get all statuses associated with a user.
*
* @param User $user
@laracasts
laracasts / MailTestCase.php
Created Jun 14, 2014
Use Mailcatcher to test email.
View MailTestCase.php
<?php
use GuzzleHttp\Message\Response;
class MailTestCase extends TestCase {
protected $mailcatcher;
function __construct()
{
View gist:99535e8db4298056b76d
<?= 'Add your Wii U username below'; ?>
@laracasts
laracasts / ApiTester.php
Last active Feb 6, 2020
Incremental APISs: Refactoring Tests and Traits
View ApiTester.php
<?php
use Faker\Factory as Faker;
abstract class ApiTester extends TestCase {
/**
* @var Faker
*/
protected $fake;
View ApiTester.php
<?php
use Faker\Factory as Faker;
abstract class ApiTester extends TestCase {
/**
* @var int
*/
protected $times = 1;
@laracasts
laracasts / ApiTester.php
Created Apr 9, 2014
Incremental APIs: Level 9 - Tests (Readable Ones!)
View ApiTester.php
<?php
use Faker\Factory as Faker;
class ApiTester extends TestCase {
/**
* @var Faker
*/
protected $fake;
@laracasts
laracasts / gulpfile.js
Last active Aug 29, 2019
Example Laravel-specific Gulpfile from Laracasts.com
View gulpfile.js
var gulp = require('gulp');
var gutil = require('gulp-util');
var notify = require('gulp-notify');
var sass = require('gulp-ruby-sass');
var autoprefix = require('gulp-autoprefixer');
var minifyCSS = require('gulp-minify-css')
var coffee = require('gulp-coffee');
var exec = require('child_process').exec;
var sys = require('sys');
@laracasts
laracasts / test.php
Last active Jul 10, 2018
Transactions for functional/integration tests.
View test.php
<?php
class ExampleTest extends TestCase {
public function setUp()
{
parent::setUp();
DB::beginTransaction();
}
View gist:7628742
@mixin linear-gradient($options...) {
background: -webkit-linear-gradient($details);
background: -moz-linear-gradient($details);
background: linear-gradient($details);
}
.foo {
@include linear-gradient(top, red, green);
}
You can’t perform that action at this time.