|
|
@ -382,13 +382,22 @@ class TestFeed extends \JKingWeb\Arsse\Test\AbstractTest { |
|
|
|
|
|
|
|
public function testApplyFilterRules(): void { |
|
|
|
\Phake::when(Arsse::$db)->feedMatchIds->thenReturn(new Result([ |
|
|
|
['id' => 7, 'guid' => '0f2a218c311e3d8105f1b075142a5d26dabf056ffc61abe77e96c8f071bbf4a7', 'url_title_hash' => "", 'url_content_hash' => '', 'title_content_hash' => ''], |
|
|
|
['id' => 47, 'guid' => '1c19e3b9018bc246b7414ae919ddebc88d0c575129e8c4a57b84b826c00f6db5', 'url_title_hash' => "", 'url_content_hash' => '', 'title_content_hash' => ''], |
|
|
|
['id' => 2112, 'guid' => '964db0b9292ad0c7a6c225f2e0966f3bda53486fae65db0310c97409974e65b8', 'url_title_hash' => "", 'url_content_hash' => '', 'title_content_hash' => ''], |
|
|
|
['id' => 1, 'guid' => '436070cda5713a0d9a8fdc8652c7ab142f0550697acfd5206a16c18aee355039', 'url_title_hash' => "", 'url_content_hash' => '', 'title_content_hash' => ''], |
|
|
|
['id' => 42, 'guid' => '1a731433a1904220ef26e731ada7262e1d5bcecae53e7b5df9e1f5713af6e5d3', 'url_title_hash' => "", 'url_content_hash' => '', 'title_content_hash' => ''], |
|
|
|
// these are the sixth through tenth entries in the feed; the title hashes have been omitted for brevity |
|
|
|
['id' => 7, 'guid' => '0f2a218c311e3d8105f1b075142a5d26dabf056ffc61abe77e96c8f071bbf4a7', 'edited' => null, 'url_title_hash' => "", 'url_content_hash' => '', 'title_content_hash' => ''], |
|
|
|
['id' => 47, 'guid' => '1c19e3b9018bc246b7414ae919ddebc88d0c575129e8c4a57b84b826c00f6db5', 'edited' => null, 'url_title_hash' => "", 'url_content_hash' => '', 'title_content_hash' => ''], |
|
|
|
['id' => 2112, 'guid' => '964db0b9292ad0c7a6c225f2e0966f3bda53486fae65db0310c97409974e65b8', 'edited' => null, 'url_title_hash' => "", 'url_content_hash' => '', 'title_content_hash' => ''], |
|
|
|
['id' => 1, 'guid' => '436070cda5713a0d9a8fdc8652c7ab142f0550697acfd5206a16c18aee355039', 'edited' => null, 'url_title_hash' => "", 'url_content_hash' => '', 'title_content_hash' => ''], |
|
|
|
['id' => 42, 'guid' => '1a731433a1904220ef26e731ada7262e1d5bcecae53e7b5df9e1f5713af6e5d3', 'edited' => null, 'url_title_hash' => "", 'url_content_hash' => '', 'title_content_hash' => ''], |
|
|
|
])); |
|
|
|
$f = new Feed(null, $this->base."Filtering/1"); |
|
|
|
$this->markTestIncomplete(); |
|
|
|
\Phake::when(Arsse::$db)->feedRulesGet->thenReturn([ |
|
|
|
'jack' => ['keep' => "", 'block' => '`A|W|J|S`u'], |
|
|
|
'sam' => ['keep' => "`B|T|X`u", 'block' => '`C`u'], |
|
|
|
]); |
|
|
|
$f = new Feed(5, $this->base."Filtering/1"); |
|
|
|
$exp = [ |
|
|
|
'jack' => ['new' => [false, true, true, false, true], 'changed' => [7 => true, 47 => true, 2112 => false, 1 => true, 42 => false]], |
|
|
|
'sam' => ['new' => [false, true, false, false, false], 'changed' => [7 => false, 47 => true, 2112 => false, 1 => false, 42 => false]], |
|
|
|
]; |
|
|
|
$this->assertSame($exp, $f->filteredItems); |
|
|
|
} |
|
|
|
} |
|
|
|