Has somebody a hint?
Stripe Notice Undefined Property (MetaData) in Unit Tests
Hi Folks!
I have created a unit test in order to proof if the metadata of a Stipe customer can be updated. When I filter the test everything runs successfully hoewever if I run the test suit I recieve notices: Stripe Notice: Undefined property of Stripe\StripeObject instance: billing_title. The billing_title is a metadata for a stripe user. Here is how I test it right now:
$user = factory(User::class)->create();
$user->createOrGetStripeCustomer();
$billingData = [
'name' => $user->name,
'metadata' => [
'billing_title' => 'Dr. Prof. B',
'billing_name' => 'Kill Bill',
],
'phone' => '111111 B',
'address' => [
'line1' => 'Slaughter Road 6B',
'postal_code' => '1111 B',
'city' => 'Tinker Bell B',
]
];
$user->updateStripeCustomer($billingData);
$billingDataAssertion = [
'title' => 'Dr. Prof. B',
'name' => 'Kill Bill',
'company_name' => 'Slaughter Road 6B',
'location' => '1111 B Tinker Bell B'
];
$this->assertEquals($user->billing_address, $billingDataAssertion);
The test does not fail. However I have these notices:
PHPUnit 8.5.2 by Sebastian Bergmann and contributors.
................................................................. 65 / 94 ( 69%)
.........Stripe Notice: Undefined property of Stripe\StripeObject instance: billing_title
.Stripe Notice: Undefined property of Stripe\StripeObject instance: billing_title
Stripe Notice: Undefined property of Stripe\StripeObject instance: billing_title
Stripe Notice: Undefined property of Stripe\StripeObject instance: billing_title
................... 94 / 94 (100%)
Time: 22.32 seconds, Memory: 46.50 MB
OK (94 tests, 178 assertions)
It seems that everything is working. In production the metadata will be set and I receive the correct billing address. Do I have to worry about these notices? Can I disable them?
Best regards Alexander
Please or to participate in this conversation.