lithium\tests\cases\net\http\MediaTest::testDuplicateBasePathCheck PHP Method

testDuplicateBasePathCheck() public method

Tests that Media::asset() will not prepend path strings with the base application path if it has already been prepended.
    public function testDuplicateBasePathCheck()
    {
        $result = Media::asset('/foo/bar/image.jpg', 'image', array('base' => '/bar'));
        $this->assertEqual('/bar/foo/bar/image.jpg', $result);
        $result = Media::asset('/foo/bar/image.jpg', 'image', array('base' => '/foo/bar'));
        $this->assertEqual('/foo/bar/image.jpg', $result);
        $result = Media::asset('foo/bar/image.jpg', 'image', array('base' => 'foo'));
        $this->assertEqual('foo/img/foo/bar/image.jpg', $result);
        $result = Media::asset('/foo/bar/image.jpg', 'image', array('base' => ''));
        $this->assertEqual('/foo/bar/image.jpg', $result);
    }