expectNotToPerformAssertions(); $client = new Customer(); $client->email; } public function testSetter() { $this->expectNotToPerformAssertions(); $client = new Customer(); $client->firstname = 'toto'; $client->firstname; } public function testSetterFailWrongType() { $this->expectException(TypeError::class); $client = new Customer(); $client->optin = 'toto'; } public function testSetterFailWrongTypeCountry() { $this->expectException(TypeError::class); $client = new Customer(); $client->country = 'toto'; } public function testPropsAllSetOk() { $this->expectNotToPerformAssertions(); $client = new Customer(); $propTypes = [ 'hashcode' => (string)Str::uuid(), 'email' => 'toto@gmail.com', 'firstname' => 'string', 'lastname' => 'string', 'password' => 'StrongPassword!7', 'birthdate' => '1992-02-03', 'phone' => '0673891630', 'address' => 'string', 'address2' => 'string', 'city' => 'string', 'postcode' => 'string', 'country' => Country::afghanistan(), 'optin' => true, 'status' => true, ]; foreach ($propTypes as $prop => $type) { $client->{$prop} = $type; } } public function testPropsAllSetNotOk() { $this->expectException(TypeError::class); $client = new Customer(); $propTypes = [ 'hashcode' => (string)Str::uuid(), 'email' => 'toto@gmail.com', 'firstname' => 'string', 'lastname' => 'string', 'password' => 'StrongPassword!7', 'birthdate' => '1992-02-03', 'phone' => '0673891630', 'address' => 'string', 'address2' => 'string', 'city' => 'string', 'postcode' => 'string', 'country' => Country::afghanistan()->value, 'optin' => true, 'status' => true, ]; foreach ($propTypes as $prop => $type) { $client->{$prop} = $type; } } }