Skip to content

Instantly share code, notes, and snippets.

View JPBetley's full-sized avatar
🐢
Converting tabs and spaces

Phil Betley JPBetley

🐢
Converting tabs and spaces
View GitHub Profile
@JPBetley
JPBetley / OrderBehaviorTest.cs
Created August 2, 2013 14:00
Order Behavior Unit Test
[TestClass]
public class OrderBehaviorTest
{
private static String TALISKER = "Talisker";
[TestMethod]
public void testFillingRemovesInventory()
{
// Arrange
Order order = new Order(TALISKER, 50);
@JPBetley
JPBetley / OrderStateTest.cs
Created August 2, 2013 13:35
Order State Unit Test
// Adapted from Martin Fowler
[TestClass]
public class OrderStateTester {
private static String TALISKER = "Talisker";
private static String HIGHLAND_PARK = "Highland Park";
private Warehouse warehouse = new WarehouseImpl();
[TestInitialize]
protected void setUp() {
warehouse.add(TALISKER, 50);
@JPBetley
JPBetley / aspecttest.php
Created July 26, 2013 03:52
AspectMock Static Test
<?php
use AspectMock\Test as test;
class Foo
{
static function simpleStatic() {
return 'bees?!';
}
}
@JPBetley
JPBetley / laravel-facade-callstatic.php
Last active December 20, 2015 04:08
Laravel Facade callStatic
<?php
/**
* Handle dynamic, static calls to the object.
*
* @param string $method
* @param array $args
* @return mixed
*/
public static function __callStatic($method, $args)
@JPBetley
JPBetley / brogrammer-routes.php
Created June 21, 2013 16:08
Funny Brogrammers Laravel Routes
<?php
// app/routes.php
// By Dayle Rees
Route::group(array('before' => 'onlybrogrammers', function()
{
// First Route
Route::get('/first', function () {