Skip to content

Instantly share code, notes, and snippets.

View ambengers's full-sized avatar
🌙
A conscious speck of stardust.

Marvin Quezon ambengers

🌙
A conscious speck of stardust.
View GitHub Profile
@ambengers
ambengers / HasResponseMacros.php
Last active September 14, 2018 08:28
Test macro to better inspect response data.
<?php
namespace Tests;
use PHPUnit\Framework\Assert;
use Illuminate\Support\Collection;
use Illuminate\Foundation\Testing\TestResponse;
trait HasResponseMacros
{
@ambengers
ambengers / InteractsWithQueryFilters.php
Last active March 26, 2019 08:41
Trait for testing laravel-query-filter package
<?php
namespace Tests\Feature\Concerns;
use Illuminate\Http\Request;
use Illuminate\Http\Response;
use Illuminate\Foundation\Testing\TestResponse;
trait InteractsWithQueryFilters
{
@ambengers
ambengers / .php-cs-fixer.dist.php
Last active November 14, 2022 02:12
Rules for PHP codestyle.
<?php
$rules = [
'@PSR2' => true,
// Syntax...
'array_syntax' => ['syntax' => 'short'],
'braces' => [
'allow_single_line_anonymous_class_with_empty_body' => true,
'allow_single_line_closure' => true,
@ambengers
ambengers / Haiku.php
Last active November 16, 2022 09:14
Laravel Haiku Class
<?php
namespace App;
class Haiku
{
/**
* An array of adjectives.
*
@ambengers
ambengers / PHP Test Setup Method.sublime-snippet
Last active November 16, 2022 09:20
PHP Test Setup Method Sublime Snippet
<snippet>
<content>
protected function setUp() : void
{
parent::setUp();
${1}
}
</content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<snippet>
<content>
/** @test */
public function ${1}(${2})
{
${3}
}
</content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>test</tabTrigger>
<snippet>
<content>
public static function ${1}(${2})
{
${3}
}
</content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>smet</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<snippet>
<content>
public function ${1}(${2})
{
${3}
}
</content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>met</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<snippet>
<content>
protected function ${1}(${2})
{
${3}
}
</content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>pmet</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
[
{
"args":
{
"characters": "/**"
},
"command": "insert"
},
{
"args": null,