public function testConstructor()
 {
     $data = new ExtendedData();
     $instruction = new PaymentInstruction(123.45, 'USD', 'foo', $data);
     $this->assertEquals(123.45, $instruction->getAmount());
     $this->assertEquals('USD', $instruction->getCurrency());
     $this->assertEquals('foo', $instruction->getPaymentSystemName());
     $this->assertSame($data, $instruction->getExtendedData());
     $this->assertSame(FinancialTransaction::STATE_NEW, $instruction->getState());
     $this->assertInstanceOf('Doctrine\\Common\\Collections\\ArrayCollection', $instruction->getCredits());
     $this->assertEquals(0, count($instruction->getCredits()));
     $this->assertInstanceOf('Doctrine\\Common\\Collections\\ArrayCollection', $instruction->getPayments());
     $this->assertEquals(0, count($instruction->getPayments()));
     $this->assertEquals(0.0, $instruction->getApprovingAmount());
     $this->assertEquals(0.0, $instruction->getApprovedAmount());
     $this->assertEquals(0.0, $instruction->getDepositingAmount());
     $this->assertEquals(0.0, $instruction->getDepositedAmount());
     $this->assertEquals(0.0, $instruction->getCreditingAmount());
     $this->assertEquals(0.0, $instruction->getCreditedAmount());
     $this->assertEquals(0.0, $instruction->getReversingApprovedAmount());
     $this->assertEquals(0.0, $instruction->getReversingCreditedAmount());
     $this->assertEquals(0.0, $instruction->getReversingDepositedAmount());
     $this->assertNull($instruction->getId());
     $this->assertTrue(time() - $instruction->getCreatedAt()->getTimestamp() < 10);
     $this->assertNull($instruction->getUpdatedAt());
 }