Beispiel #1
0
    /**
     * Test that location can be set
     *
     * @return void
     */
    public function testSetLocation()
    {
        $url = "http://foo";
        $this->order->setLocation($url);

        $this->assertEquals($url, $this->order->getLocation());

        $url = 5;
        $this->order->setLocation($url);
        $this->assertInternalType("string", $this->order->getLocation());
    }
    /**
     * Test that update works as intended
     *
     * @return void
     */
    public function testUpdate()
    {
        $this->order->setLocation("http://klarna.com/foo/bar/15");
        $uri = $this->order->getLocation();
        $this->order->update(
            array(
                'foo' => 'boo'
            )
        );

        $this->assertEquals("POST", $this->connector->applied["method"]);
        $this->assertEquals($this->order, $this->connector->applied["resource"]);
        $this->assertArrayHasKey("url", $this->connector->applied["options"]);
        $this->assertEquals($uri, $this->connector->applied["options"]["url"]);
    }