Skip to content

Commit

Permalink
url support
Browse files Browse the repository at this point in the history
  • Loading branch information
alexdebril committed Nov 21, 2015
1 parent fd461b9 commit 66b865c
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
24 changes: 24 additions & 0 deletions src/FeedIo/Feed.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,37 @@ class Feed extends Node implements FeedInterface
*/
protected $items;

/**
* @var string $url
*/
protected $url;

public function __construct()
{
$this->items = new \ArrayIterator();

parent::__construct();
}

/**
* @return string $url
*/
public function getUrl()
{
return $this->url;
}

/**
* @param string $url
* @return FeedInterface
*/
public function setUrl($url)
{
$this->url = $url;

return $this;
}

/**
* (PHP 5 &gt;= 5.0.0)<br/>
* Return the current element
Expand Down
10 changes: 10 additions & 0 deletions tests/FeedIo/FeedTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,4 +88,14 @@ public function testAdd()
$this->assertAttributeEquals(new \ArrayIterator(array($item)), 'items', $this->object);
$this->assertEquals($this->object->current(), $item);
}

public function testUrl()
{
$url = 'http://localhost';

$feed = new Feed;
$feed->setUrl($url);

$this->assertEquals($url, $feed->getUrl());
}
}

0 comments on commit 66b865c

Please sign in to comment.