Skip to content

Instantly share code, notes, and snippets.

@laracasts
laracasts / StatusRepository.php
Last active May 19, 2018 15:11
Integration Testing Repositories That Use Eloquent (with Codeception)
<?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 June 14, 2014 22:35
Use Mailcatcher to test email.
<?php
use GuzzleHttp\Message\Response;
class MailTestCase extends TestCase {
protected $mailcatcher;
function __construct()
{
@laracasts
laracasts / gist:99535e8db4298056b76d
Created May 30, 2014 19:20
Mario Kart Wii U Signups
<?= 'Add your Wii U username below'; ?>
@laracasts
laracasts / ApiTester.php
Last active February 6, 2020 15:57
Incremental APISs: Refactoring Tests and Traits
<?php
use Faker\Factory as Faker;
abstract class ApiTester extends TestCase {
/**
* @var Faker
*/
protected $fake;
@laracasts
laracasts / ApiTester.php
Last active August 29, 2015 13:58
Example
<?php
use Faker\Factory as Faker;
abstract class ApiTester extends TestCase {
/**
* @var int
*/
protected $times = 1;
@laracasts
laracasts / ApiTester.php
Created April 9, 2014 23:53
Incremental APIs: Level 9 - Tests (Readable Ones!)
<?php
use Faker\Factory as Faker;
class ApiTester extends TestCase {
/**
* @var Faker
*/
protected $fake;
@laracasts
laracasts / gulpfile.js
Last active February 10, 2024 10:57
Example Laravel-specific Gulpfile from Laracasts.com
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 July 10, 2018 16:33
Transactions for functional/integration tests.
<?php
class ExampleTest extends TestCase {
public function setUp()
{
parent::setUp();
DB::beginTransaction();
}
@laracasts
laracasts / gist:7628742
Created November 24, 2013 16:05
.scss vs .sass.
@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);
}