Skip to content

Instantly share code, notes, and snippets.

@lolgzs
lolgzs / gist:4044294
Created November 9, 2012 07:45
Testing View PHP / Storm
abstract class Admin_SuggestionAchatControllerTestCase extends Admin_AbstractControllerTestCase {
public function setUp() {
parent::setUp();
Storm_Test_ObjectWrapper::onLoaderOfModel('SuggestionAchat')
->whenCalled('findAllBy')
->with(['order' => 'date_creation'])
->answers([
SuggestionAchat::newInstanceWithId(2, ['date_creation' => '2012-03-01',
'titre' => 'Harry Potter',
'auteur' => 'J.K.Rowling',
@lolgzs
lolgzs / MinimizeSingleton.php
Created September 7, 2012 20:51
MinimizeSingletonTest pour Johan
<?php
/**
* $result sera un tableau de lignes:
* nombre_occurences chemin/vers/fichier.php:Ma_Classe::instance
*/
exec('grep -ro --include="*.php" "\([A-Za-z_]*\)::instance" *|sort|uniq -c|grep -v 1', $result);
$infections = [];
array_map(
function($line) use (&$infections) {