CakePdf\Test\TestCase\Pdf\CakePdfTest::testMargin PHP Метод

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

public testMargin ( $config )
    public function testMargin($config)
    {
        $pdf = new CakePdf($config);
        $pdf->margin(15, 20, 25, 30);
        $expected = ['bottom' => 15, 'left' => 20, 'right' => 25, 'top' => 30];
        $this->assertEquals($expected, $pdf->margin());
        $pdf = new CakePdf($config);
        $pdf->margin(75);
        $expected = ['bottom' => 75, 'left' => 75, 'right' => 75, 'top' => 75];
        $this->assertEquals($expected, $pdf->margin());
        $pdf = new CakePdf($config);
        $pdf->margin(20, 50);
        $expected = ['bottom' => 20, 'left' => 50, 'right' => 50, 'top' => 20];
        $this->assertEquals($expected, $pdf->margin());
        $pdf = new CakePdf($config);
        $pdf->margin(['left' => 120, 'right' => 30, 'top' => 34, 'bottom' => 15]);
        $expected = ['bottom' => 15, 'left' => 120, 'right' => 30, 'top' => 34];
        $this->assertEquals($expected, $pdf->margin());
        $pdf = new CakePdf($config);
        $expected = ['bottom' => 15, 'left' => 50, 'right' => 30, 'top' => 45];
        $this->assertEquals($expected, $pdf->margin());
    }