Closed AliMsayleb closed 4 years ago
Hey @AliMsayleb, and thank you for making your first contribution to this library, which makes me glad!
Could you please add the following tests to the ProjectFactoryTest
class, right after the it_can_handle_a_credentials_path()
test here?
/**
* @test
* @group legacy
* @expectedDeprecation The %s method is deprecated (4.33 Use the component-specific create*() methods instead.).
*/
public function it_can_handle_a_credentials_string()
{
$this->firebaseFactory
->expects($this->once())
->method('withServiceAccount');
$credentials = file_get_contents(__DIR__.'/../../_fixtures/valid_credentials.json');
$this->factory->create(['credentials' => $credentials]);
}
/**
* @test
* @group legacy
* @expectedDeprecation The %s method is deprecated (4.33 Use the component-specific create*() methods instead.).
*/
public function it_can_handle_a_credentials_array()
{
$this->firebaseFactory
->expects($this->once())
->method('withServiceAccount');
$credentials = json_decode(file_get_contents(__DIR__.'/../../_fixtures/valid_credentials.json'), true);
$this->factory->create(['credentials' => $credentials]);
}
I already tested those tests locally, but I would like them to be attributed to you as well instead of me adding them after the merge :)
This way we can make sure that the array support you added is fully tested and won't break with future changes.
Thanks! 🌺
In the code of the Service account which is taking the credentials, there is a function to handle credentials being sent from array But in the Configuration file it's not allowing it being sent in this way The other way would be like this
Which is pretty much the same just a bit clearer
(Please note that this is the first time i contribute to an open source library so i really don't know about the process of what should be done)