|
| 1 | +<?php |
| 2 | + |
| 3 | +namespace PubNubTests\Features\Context\AccessManager; |
| 4 | + |
| 5 | +use Behat\Behat\Context\Context; |
| 6 | +use Behat\Behat\Tester\Exception\PendingException; |
| 7 | +use PubNub\PNConfiguration; |
| 8 | +use PubNubTests\Features\Context\AccessManager\Traits; |
| 9 | +use PubNubTests\Features\Context\PubNubContext; |
| 10 | + |
| 11 | +/** |
| 12 | + * Defines application features from the specific context. |
| 13 | + */ |
| 14 | +class GrantTokenContext extends PubNubContext implements Context |
| 15 | +{ |
| 16 | + use Traits\Given; |
| 17 | + use Traits\When; |
| 18 | + use Traits\Then; |
| 19 | + |
| 20 | + protected $resource = null; |
| 21 | + protected $pattern = null; |
| 22 | + protected $token; |
| 23 | + |
| 24 | + /** |
| 25 | + * @Given I have a keyset with access manager enabled - without secret key |
| 26 | + */ |
| 27 | + public function iHaveAKeysetWithAccessManagerEnabledWithoutSecretKey() |
| 28 | + { |
| 29 | + throw new PendingException(); |
| 30 | + } |
| 31 | + |
| 32 | + /** |
| 33 | + * @Given a valid token with permissions to publish with channel :arg1 |
| 34 | + */ |
| 35 | + public function aValidTokenWithPermissionsToPublishWithChannel($arg1) |
| 36 | + { |
| 37 | + throw new PendingException(); |
| 38 | + } |
| 39 | + |
| 40 | + /** |
| 41 | + * @When I publish a message using that auth token with channel :arg1 |
| 42 | + */ |
| 43 | + public function iPublishAMessageUsingThatAuthTokenWithChannel($arg1) |
| 44 | + { |
| 45 | + throw new PendingException(); |
| 46 | + } |
| 47 | + |
| 48 | + /** |
| 49 | + * @Then the result is successful |
| 50 | + */ |
| 51 | + public function theResultIsSuccessful() |
| 52 | + { |
| 53 | + throw new PendingException(); |
| 54 | + } |
| 55 | + |
| 56 | + /** |
| 57 | + * @Given an expired token with permissions to publish with channel :arg1 |
| 58 | + */ |
| 59 | + public function anExpiredTokenWithPermissionsToPublishWithChannel($arg1) |
| 60 | + { |
| 61 | + throw new PendingException(); |
| 62 | + } |
| 63 | + |
| 64 | + /** |
| 65 | + * @When I attempt to publish a message using that auth token with channel :arg1 |
| 66 | + */ |
| 67 | + public function iAttemptToPublishAMessageUsingThatAuthTokenWithChannel($arg1) |
| 68 | + { |
| 69 | + throw new PendingException(); |
| 70 | + } |
| 71 | + |
| 72 | + /** |
| 73 | + * @Then an auth error is returned |
| 74 | + */ |
| 75 | + public function anAuthErrorIsReturned() |
| 76 | + { |
| 77 | + throw new PendingException(); |
| 78 | + } |
| 79 | + |
| 80 | + /** |
| 81 | + * @Then the auth error message is :arg1 |
| 82 | + */ |
| 83 | + public function theAuthErrorMessageIs($arg1) |
| 84 | + { |
| 85 | + throw new PendingException(); |
| 86 | + } |
| 87 | + |
| 88 | + /** |
| 89 | + * @Given The SDK is configured with an AuthKey representing an access Token |
| 90 | + */ |
| 91 | + public function theSdkIsConfiguredWithAnAuthkeyRepresentingAnAccessToken() |
| 92 | + { |
| 93 | + throw new PendingException(); |
| 94 | + } |
| 95 | + |
| 96 | + /** |
| 97 | + * @When I publish a messages |
| 98 | + */ |
| 99 | + public function iPublishAMessages() |
| 100 | + { |
| 101 | + throw new PendingException(); |
| 102 | + } |
| 103 | + |
| 104 | + /** |
| 105 | + * @Then The request uses the specified access token for authorization |
| 106 | + */ |
| 107 | + public function theRequestUsesTheSpecifiedAccessTokenForAuthorization() |
| 108 | + { |
| 109 | + throw new PendingException(); |
| 110 | + } |
| 111 | + |
| 112 | + /** |
| 113 | + * @Given I have associated an access token with the SDK instance |
| 114 | + */ |
| 115 | + public function iHaveAssociatedAnAccessTokenWithTheSdkInstance() |
| 116 | + { |
| 117 | + throw new PendingException(); |
| 118 | + } |
| 119 | + |
| 120 | + /** |
| 121 | + * @When I request the current access token via the getToken operation |
| 122 | + */ |
| 123 | + public function iRequestTheCurrentAccessTokenViaTheGettokenOperation() |
| 124 | + { |
| 125 | + throw new PendingException(); |
| 126 | + } |
| 127 | + |
| 128 | + /** |
| 129 | + * @Then The token returned matches |
| 130 | + */ |
| 131 | + public function theTokenReturnedMatches() |
| 132 | + { |
| 133 | + throw new PendingException(); |
| 134 | + } |
| 135 | + |
| 136 | + /** |
| 137 | + * @Given I have not associated an access token with the SDK instance |
| 138 | + */ |
| 139 | + public function iHaveNotAssociatedAnAccessTokenWithTheSdkInstance() |
| 140 | + { |
| 141 | + throw new PendingException(); |
| 142 | + } |
| 143 | + |
| 144 | + /** |
| 145 | + * @Then A non-error response indicating no token is associated will be returned |
| 146 | + */ |
| 147 | + public function aNonErrorResponseIndicatingNoTokenIsAssociatedWillBeReturned() |
| 148 | + { |
| 149 | + throw new PendingException(); |
| 150 | + } |
| 151 | + |
| 152 | + /** |
| 153 | + * @Given I have provided an access token to the SDK via the setToken operation |
| 154 | + */ |
| 155 | + public function iHaveProvidedAnAccessTokenToTheSdkViaTheSettokenOperation() |
| 156 | + { |
| 157 | + throw new PendingException(); |
| 158 | + } |
| 159 | + |
| 160 | + /** |
| 161 | + * @Given The SDK is configured with an AuthKey representing an acess Token |
| 162 | + */ |
| 163 | + public function theSdkIsConfiguredWithAnAuthkeyRepresentingAnAcessToken() |
| 164 | + { |
| 165 | + throw new PendingException(); |
| 166 | + } |
| 167 | + |
| 168 | + /** |
| 169 | + * @Given I provide an access token to the SDK via the setToken operation |
| 170 | + */ |
| 171 | + public function iProvideAnAccessTokenToTheSdkViaTheSettokenOperation() |
| 172 | + { |
| 173 | + throw new PendingException(); |
| 174 | + } |
| 175 | + |
| 176 | + /** |
| 177 | + * @Given I indicated to the SDK to not use a token. |
| 178 | + */ |
| 179 | + public function iIndicatedToTheSdkToNotUseAToken() |
| 180 | + { |
| 181 | + throw new PendingException(); |
| 182 | + } |
| 183 | + |
| 184 | + /** |
| 185 | + * @Then The request does not include an access token |
| 186 | + */ |
| 187 | + public function theRequestDoesNotIncludeAnAccessToken() |
| 188 | + { |
| 189 | + throw new PendingException(); |
| 190 | + } |
| 191 | +} |
0 commit comments