|
@ -12,7 +12,9 @@ use JKingWeb\Arsse\Feed\Exception as FeedException; |
|
|
use Phake; |
|
|
use Phake; |
|
|
|
|
|
|
|
|
trait SeriesSubscription { |
|
|
trait SeriesSubscription { |
|
|
protected $data = [ |
|
|
|
|
|
|
|
|
public function setUpSeriesSubscription() { |
|
|
|
|
|
$this->data = [ |
|
|
'arsse_users' => [ |
|
|
'arsse_users' => [ |
|
|
'columns' => [ |
|
|
'columns' => [ |
|
|
'id' => 'str', |
|
|
'id' => 'str', |
|
@ -106,18 +108,20 @@ trait SeriesSubscription { |
|
|
] |
|
|
] |
|
|
], |
|
|
], |
|
|
]; |
|
|
]; |
|
|
|
|
|
|
|
|
public function setUpSeries() { |
|
|
|
|
|
$this->data['arsse_feeds']['rows'] = [ |
|
|
$this->data['arsse_feeds']['rows'] = [ |
|
|
[1,"http://example.com/feed1", "Ook", "", "",strtotime("now"),''], |
|
|
[1,"http://example.com/feed1", "Ook", "", "",strtotime("now"),''], |
|
|
[2,"http://example.com/feed2", "eek", "", "",strtotime("now - 1 hour"),'http://example.com/favicon.ico'], |
|
|
[2,"http://example.com/feed2", "eek", "", "",strtotime("now - 1 hour"),'http://example.com/favicon.ico'], |
|
|
[3,"http://example.com/feed3", "Ack", "", "",strtotime("now + 1 hour"),''], |
|
|
[3,"http://example.com/feed3", "Ack", "", "",strtotime("now + 1 hour"),''], |
|
|
]; |
|
|
]; |
|
|
// initialize a partial mock of the Database object to later manipulate the feedUpdate method |
|
|
// initialize a partial mock of the Database object to later manipulate the feedUpdate method |
|
|
Arsse::$db = Phake::partialMock(Database::class, $this->drv); |
|
|
Arsse::$db = Phake::partialMock(Database::class, static::$drv); |
|
|
$this->user = "john.doe@example.com"; |
|
|
$this->user = "john.doe@example.com"; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
protected function tearDownSeriesSubscription() { |
|
|
|
|
|
unset($this->data, $this->user); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
public function testAddASubscriptionToAnExistingFeed() { |
|
|
public function testAddASubscriptionToAnExistingFeed() { |
|
|
$url = "http://example.com/feed1"; |
|
|
$url = "http://example.com/feed1"; |
|
|
$subID = $this->nextID("arsse_subscriptions"); |
|
|
$subID = $this->nextID("arsse_subscriptions"); |
|
|