2021-06-27 13:19:26 +02:00
|
|
|
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
|
|
|
|
namespace OCA\GPodderSync\Tests\Unit\Core\SubscriptionChange;
|
|
|
|
|
|
|
|
use OCA\GPodderSync\Core\SubscriptionChange\SubscriptionChangesReader;
|
2021-07-13 09:43:54 +02:00
|
|
|
use Test\TestCase;
|
2021-06-27 13:19:26 +02:00
|
|
|
|
2021-07-13 09:43:54 +02:00
|
|
|
class SubscriptionChangeReaderTest extends TestCase {
|
2021-07-13 21:36:34 +02:00
|
|
|
public function testMapUrlsToSubscriptionChanges(): void {
|
|
|
|
$subscriptionChange = SubscriptionChangesReader::mapToSubscriptionsChanges(["https://feeds.megaphone.fm/HSW8286374095", "https://feeds.megaphone.fm/another"], true);
|
|
|
|
$this->assertCount(2, $subscriptionChange);
|
2021-07-13 09:43:54 +02:00
|
|
|
$this->assertSame("https://feeds.megaphone.fm/HSW8286374095", $subscriptionChange[0]->getUrl());
|
2021-07-13 21:36:34 +02:00
|
|
|
$this->assertSame("https://feeds.megaphone.fm/another", $subscriptionChange[1]->getUrl());
|
2021-06-27 13:19:26 +02:00
|
|
|
}
|
|
|
|
|
2021-12-09 20:19:35 +01:00
|
|
|
|
|
|
|
public function testNonUrisAreOmmited(): void {
|
|
|
|
$subscriptionChange = SubscriptionChangesReader::mapToSubscriptionsChanges([
|
|
|
|
"https://feeds.megaphone.fm/HSW8286374095",
|
|
|
|
"antennapod_local:content://com.android.externalstorage.documents/tree/home:podcast"
|
|
|
|
], true);
|
|
|
|
$this->assertCount(1, $subscriptionChange);
|
|
|
|
$this->assertSame("https://feeds.megaphone.fm/HSW8286374095", $subscriptionChange[0]->getUrl());
|
|
|
|
}
|
|
|
|
|
2021-06-27 13:19:26 +02:00
|
|
|
}
|