stormpath-sdk-php
stormpath-sdk-php copied to clipboard
Options do not reset after request
During development of the Laravel Integration, I found that when running the ['expand'=>'something'] it does not clear out for the next request. This causes all sorts of errors for future requests on the same page load where the expand is not available on a different resource.
Might be the same issue we have experienced https://github.com/stormpath/stormpath-sdk-php/issues/48 ?
@dkvk I am not sure that it is a caching issue here. I tested with caching turned off and still had the problem. If you do have the issue, you can run a method setOptions([]) to empty out the options array after you make a request.
I was not able to reproduce this issue again after some updates to caching, so It is possible now that these were related. I wrote some tests to make sure that the options array is cleared for each request. See commit a6f25043dd726d805ab95d0b968bb7d0ad6c7cff
This issue is back..
I removed the test for now.
/** @test */
public function the_options_array_is_cleared_after_each_request()
{
$tenant = self::$client->getDataStore()->getResource('/tenants/current', Stormpath::TENANT, ['expand'=>'applications']);
foreach($tenant->getApplications() as $application) {
$this->assertEmpty($application->getAccounts()->getOptions());
}
}
This should be looked at. The test above is passing locally but not on travis?