Skip to content

Instantly share code, notes, and snippets.

View jwalton512's full-sized avatar

Jason Walton jwalton512

View GitHub Profile
@jwalton512
jwalton512 / gist:1c12e8a50d17245cdcdd
Created August 24, 2014 17:15
phpspec callback matcher
function it_handles_register_command(MemberRepository $members)
{
$command = new MemberRegisterCommand('email', 'password', 'password');
$members->save(Argument::that(function($member) {
return ($member->email == 'email' && $member->password == 'password');
}))->shouldBeCalled();
$this->handle($command)->shouldBeAnInstanceOf(MemberRegisterCommandResponse::class);
}
@jwalton512
jwalton512 / .env.json
Last active August 29, 2015 14:05
Setting Laravel environment for acceptance testing (in Behat)
{"env":"local"}
@jwalton512
jwalton512 / example_scenario
Created November 12, 2014 16:32
An example web scenario
Scenario: Searching for a page that does exist
Given I am on "/wiki/Main_Page"
When I fill in "search" with "Behavior Driven Development"
And I press "searchButton"
Then I should see "agile software development"
@jwalton512
jwalton512 / domain_modelling_example
Created November 12, 2014 20:43
Example of domain modeling by example
Scenario: Register for an event
Given there is an event open for registration
When I register for the event
Then I should have an event on my schedule
@jwalton512
jwalton512 / BusServiceProvider.php
Created January 27, 2015 16:57
snake_case and camelCase in L5 Dispatcher
<?php namespace App\Providers;
use App\Bus\Dispatcher;
use Illuminate\Support\ServiceProvider;
class BusServiceProvider extends ServiceProvider {
/**
* Bootstrap any application services.
*
@jwalton512
jwalton512 / gulpfile.js
Created June 4, 2015 14:25
elixir+less+scripts+browserify+version
elixir(function (mix) {
mix.less('app.less')
.less('admin.less')
.scripts(['libs/**/*.js', 'app/**/**/*.js'], 'resources/assets/build/app.js')
.browserify('app.js', 'public/js/app.js', 'resources/assets/build')
.version('js/app.js')
});
@jwalton512
jwalton512 / admin.js
Created June 11, 2015 15:13
learning vue.js
var track = require('./track');
@jwalton512
jwalton512 / Api\Admin\TestCase.php
Created August 9, 2015 08:46
Api Testing With Laravel 5.1 (jwt-auth)
<?php
namespace Tests\Api;
use App\User;
use Tests\TestCase as BaseTestCase;
use Illuminate\Contracts\Auth\Authenticatable as UserContract;
class TestCase extends BaseTestCase
{
@jwalton512
jwalton512 / admin(v2).js
Last active May 15, 2018 19:41
Harmony with Laravel + Vue + Vue Router
// dashboard component
var dashboard = Vue.extend({
template: '<p>Hello from dashboard</p>'
})
// user management component
var user = Vue.extend({
template: '<p>Hello from user management page</p>'
})
@jwalton512
jwalton512 / adddomain
Last active September 12, 2015 14:36 — forked from simonj/adddomain
app.js
module.exports = {
}