Skip to content

Commit

Permalink
dev: Fix some tests for PHPStan
Browse files Browse the repository at this point in the history
  • Loading branch information
marienfressinaud committed Dec 10, 2024
1 parent 42d40c0 commit f61b13f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tests/lib/SpiderBits/HttpTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ public function testGetWithSettingHeaders(): void
$this->assertSame(200, $response->status);
$data = json_decode($response->data, true);
$this->assertIsArray($data);
$this->assertIsArray($data['headers']);
$this->assertSame('foo', $data['headers']['HTTP_X_CUSTOM']);
}

Expand All @@ -103,6 +104,7 @@ public function testGetWithSettingGlobalHeaders(): void
$this->assertSame(200, $response->status);
$data = json_decode($response->data, true);
$this->assertIsArray($data);
$this->assertIsArray($data['headers']);
$this->assertSame('foo', $data['headers']['HTTP_X_CUSTOM']);
}

Expand All @@ -122,6 +124,7 @@ public function testGetWithSettingUserAgent(): void
$this->assertSame(200, $response->status);
$data = json_decode($response->data, true);
$this->assertIsArray($data);
$this->assertIsArray($data['headers']);
$this->assertSame($user_agent, $data['headers']['HTTP_USER_AGENT']);
}

Expand Down Expand Up @@ -151,6 +154,7 @@ public function testPostWithParameters(): void
$this->assertSame(200, $response->status);
$data = json_decode($response->data, true);
$this->assertIsArray($data);
$this->assertIsArray($data['form']);
$this->assertSame($parameters['foo'], $data['form']['foo']);
$this->assertSame($parameters['baz'], $data['form']['baz']);
}
Expand Down
2 changes: 2 additions & 0 deletions tests/lib/SpiderBits/OpmlTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ public function testFromTextWithFreshRss(): void
$outlines = $opml->outlines[0]['outlines'];
$this->assertIsArray($outlines);
$this->assertSame(3, count($outlines));
$this->assertIsArray($outlines[0]);
$this->assertSame('Framablog', $outlines[0]['text']);
$this->assertSame('rss', $outlines[0]['type']);
$this->assertSame('https://framablog.org/feed/', $outlines[0]['xmlUrl']);
Expand Down Expand Up @@ -58,6 +59,7 @@ public function testFromTextWithFeedly(): void
$outlines = $opml->outlines[0]['outlines'];
$this->assertIsArray($outlines);
$this->assertSame(3, count($outlines));
$this->assertIsArray($outlines[0]);
$this->assertSame('Framablog', $outlines[0]['text']);
$this->assertSame('Framablog', $outlines[0]['title']);
$this->assertSame('rss', $outlines[0]['type']);
Expand Down
1 change: 1 addition & 0 deletions tests/services/DataExporterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ public function testExportCreatesOpmlFile(): void
]);
$collection_3_url = \Minz\Url::absoluteFor('collection', ['id' => $collection_3->id]);
$group_outlines = $opml->outlines[2]['outlines'];
$this->assertIsArray($group_outlines[0]);
$this->assertSame($collection_3_url_feed, $group_outlines[0]['xmlUrl']);
$this->assertSame($collection_3_url, $group_outlines[0]['htmlUrl']);
}
Expand Down

0 comments on commit f61b13f

Please sign in to comment.