public function testDepositShouldRegisterWithAfipWhenAmoutGreaterThanAHundred() { // arrange $account = new BankAccount('Nicolas'); $value = 500; $afipMock = $this->getMock('Afip', array('registerTransaction')); $afipMock->expects($this->once())->method('registerTransaction')->with($this->equalTo('Nicolas'), $this->equalTo($value)); $account->setAfip($afipMock); $amountToTransfer = 500; // act $account->deposit(500); // assert $this->assertEquals($amountToTransfer, $account->getBalance()); }