Bitpay\PayoutTest::testAddInstruction PHP Метод

testAddInstruction() публичный Метод

public testAddInstruction ( )
    public function testAddInstruction()
    {
        $this->assertTrue(count($this->payout->getInstructions()) == 0);
        $instruction = new PayoutInstruction();
        $instruction->setAddress('1LbEH8w3KGfTTt2L69bSR3d73njvvpm5tU')->setLabel('payout label')->setAmount(10);
        $this->payout->addInstruction($instruction);
        $this->assertTrue(count($this->payout->getInstructions()) == 1);
        $instructions = $this->payout->getInstructions();
        $this->assertSame($instruction, $instructions[0]);
        $other = new PayoutInstruction();
        $other->setAddress('1L3cPDuruzGLfmmGbJgwoAjU51D6AqxaKK')->setLabel('id for employee')->setAmount(50);
        $this->payout->addInstruction($other);
        $this->assertTrue(count($this->payout->getInstructions()) == 2);
        $instructions = $this->payout->getInstructions();
        $this->assertSame($other, $instructions[1]);
    }