Skip to content

Instantly share code, notes, and snippets.

View dugajean's full-sized avatar

Dugi dugajean

View GitHub Profile
@dugajean
dugajean / HttpStreamWrapperTestCase.php
Created August 15, 2019 12:19 — forked from ukolka/HttpStreamWrapperTestCase.php
PHPUnit extension for testing code that's using PHP's http:// stream wrapper context to make requests.
<?php
namespace tests\unittests\custom;
/**
* Whenever PHP HTTP stream is used you can
* inject a mock stream resource into an object that
* expect it.
*
* Usage example:
*
* ...
import React, { Component } from 'react'; // Bad import, "Component" is a named import within the react library. No more than 1 default export per file
import PropTypes from 'prop-types';
import queryAPI from 'queryAPI';
class ShowResultsFromAPI extends Component { // Removed "()" after the Component class extension
constructor(props) { // props argument missing here
super(props);
// Removed "this.container" in this position as it didn't serve any purpose

Keybase proof

I hereby claim:

  • I am dugajean on github.
  • I am dugajean (https://keybase.io/dugajean) on keybase.
  • I have a public key ASBdXqy20hYcZbR-YT4nxr4tlX9UBPA5dOf-yXTysPTahwo

To claim this, I am signing this object:

function setup() {
createCanvas(700, 770);
background(0);
}
function draw() {
fill(255, 0, 0);
rect(100, 0, 600, 600);
fill(255, 255, 255);