Skip to content

Instantly share code, notes, and snippets.

@kaphert
kaphert / ViewAssertions.php
Created September 14, 2018 23:04
Assert that blade view files are loaded with PHPUnit in Laravel
/**
* Laravel + PHPUnit assert that blade files are being loaded.
*
* Trait AssertView
*/
trait ViewAssertions
{
protected $__loadedViews;
protected function captureLoadedViews()
@kaphert
kaphert / http_status_code_to_message.php
Last active October 26, 2017 16:06
Map HTTP Status Code to Message PHP array
<?php
/**
* Based on http://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml
*/
$map = [
100 => 'Continue',
101 => 'Switching Protocols',
102 => 'Processing',
200 => 'OK',
201 => 'Created',