Skip to content

Commit

Permalink
update testcase
Browse files Browse the repository at this point in the history
  • Loading branch information
yethusoe91 committed Oct 23, 2023
1 parent 4e5498a commit f1f6320
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 15 deletions.
14 changes: 0 additions & 14 deletions src/Validators/Platforms/Facebook.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,25 +7,11 @@
class Facebook extends AbstractValidator
{
protected array $patterns = [
'~facebook\.com/([^/]+)/(posts|activity|photos)/([^/]+)/?~i',
'~facebook\.com/notes/([^/]+)/(?:[^/]+)/([^/]+)/?~i',
'~facebook\.com/(photo|permalink)\.php\?(?:(?:story_)?fbid)=([^ ]+)~i',
'~facebook\.com/(photos|questions)/([^/ ]+)/?~i',
'~facebook\.com/media/set/?\?set=([^/ ]+)~i',
'~facebook\.com/([^/]+)/videos/([^/]+)/?~i',
'~facebook\.com/video\.php\?(?:id|v)=([^ ]+)~i',
'~facebook\.com/pages/([^/]+)(.*)~',
'~facebook\.com/([^/]+)(.*)~',
];

protected array $patternMaps = [
['type' => 2, 'id' => 3, 'parent_id' => 1],
['type' => 'notes', 'id' => 2, 'parent_id' => 1],
['type' => 1, 'id' => 2, 'parent_id' => null],
['type' => 1, 'id' => 2, 'parent_id' => null],
['type' => 'media_set', 'id' => 1, 'parent_id' => null],
['type' => 'videos', 'id' => 2, 'parent_id' => 1],
['type' => 'videos', 'id' => 1, 'parent_id' => null],
['type' => 'pages', 'id' => 1, 'parent_id' => null],
['type' => 'profile', 'id' => 1, 'parent_id' => null],
];
Expand Down
4 changes: 3 additions & 1 deletion tests/Datasets/Platforms.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@

dataset('platforms', [
['facebook', 'https://facebook.com/ageekdev'],
['twitter', 'https://twitter.com/ageekdev'],
['instagram', 'https://www.instagram.com/laravelnews'],
['line', 'https://line.me/R/ti/p/~ageekdev'],
['linkedin', 'https://www.linkedin.com/company/laravel-news'],
['twitter', 'https://twitter.com/ageekdev'],
['whatsapp', 'https://wa.me/1/+660838128312'],
['youtube', 'https://youtube.com/channel/gkucmierz'],
]);

0 comments on commit f1f6320

Please sign in to comment.