2021-06-27 11:19:26 +00:00
|
|
|
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
|
|
|
|
namespace OCA\GPodderSync\Tests\Unit\Core\SubscriptionChange;
|
|
|
|
|
|
|
|
use OCA\GPodderSync\Core\SubscriptionChange\SubscriptionChangeRequestParser;
|
|
|
|
use OCA\GPodderSync\Core\SubscriptionChange\SubscriptionChangesReader;
|
2021-07-13 07:43:54 +00:00
|
|
|
use Test\TestCase;
|
2021-06-27 11:19:26 +00:00
|
|
|
|
2021-07-13 07:43:54 +00:00
|
|
|
class SubscriptionChangeRequestParserTest extends TestCase {
|
2021-06-27 11:19:26 +00:00
|
|
|
public function testSubscriptionRequestConvertsToSubscriptionChangeList() {
|
|
|
|
$subscriptionChangesParser = new SubscriptionChangeRequestParser(
|
|
|
|
new SubscriptionChangesReader(),
|
|
|
|
);
|
|
|
|
|
2021-07-13 19:36:34 +00:00
|
|
|
$subscriptionChanges = $subscriptionChangesParser->createSubscriptionChangeList(["https://feeds.simplecast.com/54nAGcIl", "https://feeds.simplecast.com/another"],["https://i.am-removed/GcIl"]);
|
|
|
|
$this->assertCount(3, $subscriptionChanges);
|
|
|
|
$this->assertSame("https://feeds.simplecast.com/54nAGcIl", $subscriptionChanges[0]->getUrl());
|
|
|
|
$this->assertSame("https://feeds.simplecast.com/another", $subscriptionChanges[1]->getUrl());
|
|
|
|
$this->assertSame("https://i.am-removed/GcIl", $subscriptionChanges[2]->getUrl());
|
2021-06-27 11:19:26 +00:00
|
|
|
$this->assertTrue($subscriptionChanges[0]->isSubscribed());
|
2021-07-13 19:36:34 +00:00
|
|
|
$this->assertFalse($subscriptionChanges[2]->isSubscribed());
|
2021-06-27 11:19:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|