Skip to content

Instantly share code, notes, and snippets.

<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title></title>
<link rel="stylesheet" href="theme.css" type="text/css" />
</head>
<body>
interface MapperInterface
{
public function map();
}
abstract class BaseUserMapper
{
public function __construct($userEntity)
{
$this->user = $userEntity;
@mvriel
mvriel / MyClass.php
Created September 4, 2014 09:44
Why does my test not fail on the second mockedMethod call?
<?php
class MyClass
{
public function test($dependency)
{
$dependency->mockedMethod('I have random arguments');
$dependency->mockedMethod(
array(
'choices' => array(
@mvriel
mvriel / gist:c811f7996ed28b478bf9
Created September 4, 2014 07:30
Mocking two invocations of one call with different arguments
<?php
$resolverMock = m::mock('Symfony\Component\OptionsResolver\OptionsResolver');
$resolverMock->shouldReceive('setNormalizers');
$resolverMock->shouldReceive('setAllowedTypes');
$resolverMock->shouldReceive('setDefaults')->atMost()->once()->withAnyArgs();
$resolverMock->shouldReceive('setDefaults')->atLeast()->once()->with(
array(
'label' => 'MyLabel',
'choices' => array(
'1' => 'Option1',