Example #1
0
 public function testRetrieveToken()
 {
     $oConnector = new \Prowl\Connector();
     $oConnector->setProviderKey($this->aConfig['providerkey']);
     $oTokenResponse = $oConnector->retrieveToken();
     $this->assertTrue(filter_var($oTokenResponse->getTokenUrl(), FILTER_VALIDATE_URL) !== false);
     $this->assertNotNull($oTokenResponse->getToken());
 }
Example #2
0
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 */
/**
 * Example File
 * @author Mario Mueller <*****@*****.**>
 * @version 1.0.0
 */
require_once dirname(__FILE__) . '/bootstrap.php';
// Use \Prowl\SecureConnector to make cUrl use SSL
$oProwl = new \Prowl\Connector();
$oMsg = new \Prowl\Message();
// If you have one:
// $oProwl->setProviderKey('MY_PROVIDER_KEY');
try {
    // You can choose to pass a callback
    $oProwl->setFilterCallback(function ($sText) {
        return $sText;
    });
    // or set a filter instance:
    // $oFilter = new \Prowl\Security\PassthroughFilterImpl();
    // $oProwl->setFilter($oFilter);
    /*
     * Both, the closure and the instance, can be passed to the connector
     * or to each message. Setting it at the connector passes the closure or the instance down
     * to each message on push() execution - but only if the message has neither of them set.