betterweekdays / glassdoor
Glassdoor API
This package's canonical repository appears to be gone and the package has been frozen as a result.
Installs: 5 676
Dependents: 0
Suggesters: 0
Security: 0
Stars: 3
Watchers: 8
Forks: 4
Open Issues: 0
Requires
- guzzlehttp/guzzle: ~6.0
Requires (Dev)
- drupal/coder: ^8.2
- phpunit/phpunit: ~4.0
- squizlabs/php_codesniffer: *
This package is not auto-updated.
Last update: 2022-05-14 05:31:47 UTC
README
Installation
The preferred way to install this extension is through composer.
Either run
php composer.phar require betterweekdays/glassdoor "*"
or add
"betterweekdays/glassdoor": "*"
to the require section of your composer.json
file.
Example
- To connect to the glassdoor API first create a config object.
$config = new \Glassdoor\Config('partner id', 'partner key', 'http://api.glassdoor.com/api/api.htm', 'json');
Then Create the Connection Object.
$conn = new \Glassdoor\Connection($config);
Next create an Action and add parameters.
$action = new \Glassdoor\Action\JobProgression();
$action->addparam('job_title', 'cashier');
Finally make the call
$response = $conn->call($action);
The response will be an instance of \Glassdoor\ResponseObject\ResponseInterface which is specified by the Action.
Custom PSR7 Middleware
If you wish to add a custom PS7 Middleware then you can add a custom HandlerStack. See http://docs.guzzlephp.org/en/latest/handlers-and-middleware.html for more details
use GuzzleHttp\Client;
use GuzzleHttp\HandlerStack;
use GuzzleHttp\Handler\CurlHandler;
$handler = new CurlHandler();
$stack = HandlerStack::create($handler); // Wrap w/ middleware
$connection->setHandlerStack($stack)
Running Unit Tests
First, install any composer dependencies by running composer install
.
Next, from the root directory run php vendor/bin/phpunit
or simply phpunit
if you've set up global install.
To run tests with code coverage, run phpunit --coverage-text
.
To run acceptance (end-to-end) tests with your API credentials, run PARTNER_ID=XXX PARTNER_KEY=YYYYY phpunit
.
If you're green, you're good!
Code Standards
We are using Drupal's Code Standards and PHP_CodeSniffer to test for them.
Run the code sniffer using ./vendor/bin/phpcs --standard=./vendor/drupal/coder/coder_sniffer/Drupal src/
Actions
Implemented Endpoinsts: