lyal / checkr Goto Github PK
View Code? Open in Web Editor NEWPHP SDK for the Checkr Background Service
License: MIT License
PHP SDK for the Checkr Background Service
License: MIT License
Hi, what would be the best way to write tests like whether a listener I have runs the correct report?
I tried mocking Checkr
facade, but that's not working because Client
instantiates new Resource classes manually (new $resource(...)
).
I then tried mocking Resource
and Client
like this:
$checkrReport = Mockery::mock(Report::class);
$checkrReport
->shouldReceive('create')
->once()
->andReturn((object) ['id' => 66]);
$checkrClient = Mockery::mock(Client::class);
$checkrClient
->shouldReceive('api')
->once()
->with('report', ['package' => 'driver_pro', 'candidate_id' => 1])
->andReturn($checkrReport);
$this->app->instance(Client::class, $checkrClient);
But that didn't get me past Lyal\Checkr\Exceptions\Client\NotFound: The requested resource could not be found. Response: {"error":"TestCandidate not found"}
.
Any thoughts?
I was struggling to find out why the API key was wrong when I had set it up properly in my .env file. Turns out, it doesn't work without config file being published. README.md should make that clear.
Hey @lyal I'm getting
Unknown attribute on resource Lyal\Checkr\Entities\Resources\Report: municipal_criminal_search_ids {"exception":"[object] (Lyal\\Checkr\\Exceptions\\InvalidAttributeException(code: 0): Unknown attribute on resource Lyal\\Chec
kr\\Entities\\Resources\\Report: municipal_criminal_search_ids at [...]
Looks like municipal_criminal_search_ids
is needed as well? I just tested and it works once I add it to Resources/Report.php
.
Not sure if Checkr keeps silently adding those fields or what. Are there any side effects if I just catch InvalidAttributeException
and ignore it?
Thanks!
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Root composer.json requires lyal/checkr ^0.14.0 -> satisfiable by lyal/checkr[0.14].
- lyal/checkr 0.14 requires guzzlehttp/guzzle ~6.0|~5.0|~4.0 -> found guzzlehttp/guzzle[4.0.0-rc.1, ..., 4.x-dev, 5.0.0, ..., 5.3.x-dev, 6.0.0, ..., 6.5.x-dev] but it conflicts with your root composer.json require (^7.0.1).
Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.
Installation failed, reverting ./composer.json and ./composer.lock to their original content.
I just upgraded to laravel8 and updated my composer to use "lyal/checkr": "^0.3" and PHP 8.0
It seems that PHP 8.0 broke this.
Thanks.
Got the following error:
{
"class": "Symfony\Component\ErrorHandler\Error\FatalError",
"message": "Declaration of Lyal\Checkr\Entities\Resources\Candidate::__construct($values = null, ?Lyal\Checkr\Client $client = null) must be compatible with Lyal\Checkr\Traits\Listable::__construct($values, $client)",
"code": 0,
"file": "/var/app/current/vendor/lyal/checkr/src/Entities/Resources/Candidate.php:21"
}
Hi, thanks for doing this package!
I noticed that keys are fetched from env
directly. Wouldn't fetching from config('checkr.key_production')
be more effective as config will be cached and faster to access?
Thanks
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.