|
72 | 72 | $this->assertStringContainsStringIgnoringCase('scope='.urlencode('email,public_profile'), $redirect); |
73 | 73 | }); |
74 | 74 |
|
75 | | -it('merges scopes passed when fetching redirect URLs', function () { |
76 | | - $redirect = $this->getFacebookMock()->getRedirect(null, ['publish_actions']); |
77 | | - $this->assertStringContainsStringIgnoringCase('scope='.urlencode('publish_actions,email,public_profile'), $redirect); |
| 75 | +it('replaces duplicate scopes from class config', function () { |
| 76 | + $redirect = $this->getFacebookMock(['scopes' => ['email', 'public_profile']])->getRedirect(); |
| 77 | + $this->assertStringContainsStringIgnoringCase('scope='.urlencode('email,public_profile'), $redirect); |
78 | 78 | }); |
79 | 79 |
|
80 | | -it('builds replaces duplicate scopes with defaults', function () { |
81 | | - $redirect = $this->getFacebookMock(['scopes' => ['email', 'public_profile']])->getRedirect(); |
| 80 | +it('replaces duplicate scopes passed to method', function () { |
| 81 | + $redirect = $this->getFacebookMock()->getRedirect(null, ['email', 'public_profile']); |
82 | 82 | $this->assertStringContainsStringIgnoringCase('scope='.urlencode('email,public_profile'), $redirect); |
83 | 83 | }); |
84 | 84 |
|
85 | | -it('builds appends default scopes to requested', function () { |
86 | | - $redirect = $this->getFacebookMock(['scopes' => ['publish_actions']])->getRedirect(); |
87 | | - $this->assertStringContainsStringIgnoringCase('scope='.urlencode('publish_actions,email,public_profile'), $redirect); |
| 85 | +it('merges config scopes with default scopes', function () { |
| 86 | + $redirect = $this->getFacebookMock(['scopes' => ['publish_pages']])->getRedirect(); |
| 87 | + $this->assertStringContainsStringIgnoringCase('scope='.urlencode('publish_pages,email,public_profile'), $redirect); |
| 88 | +}); |
| 89 | + |
| 90 | +it('merges default scopes with scopes passed to method', function () { |
| 91 | + $redirect = $this->getFacebookMock()->getRedirect(null, ['publish_pages']); |
| 92 | + $this->assertStringContainsStringIgnoringCase('scope='.urlencode('publish_pages,email,public_profile'), $redirect); |
| 93 | +}); |
| 94 | + |
| 95 | +it('merges config scopes and scopes passed to the method with default scopes to', function () { |
| 96 | + $redirect = $this->getFacebookMock(['scopes' => ['publish_pages']])->getRedirect(null, ['publish_video']); |
| 97 | + $this->assertStringContainsStringIgnoringCase('scope='.urlencode('publish_pages,publish_video,email,public_profile'), $redirect); |
88 | 98 | }); |
89 | 99 |
|
90 | 100 | it('returns a valid redirect login helper instance', function () { |
|
0 commit comments