expectException(\InvalidArgumentException::class); $definition = [ 'INVALID_FIELD' => FieldOverride::HIDDEN, ]; $fieldOverrides = new FieldOverrides($definition); } /** * @covers ::__construct */ public function testInvalidOverride() { $this->expectException(\InvalidArgumentException::class); $definition = [ AddressField::POSTAL_CODE => 'INVALID', ]; $fieldOverrides = new FieldOverrides($definition); } /** * @covers ::__construct */ public function testEmptyDefinition() { $fieldOverrides = new FieldOverrides([]); $this->assertSame([], $fieldOverrides->getHiddenFields()); $this->assertSame([], $fieldOverrides->getOptionalFields()); $this->assertSame([], $fieldOverrides->getRequiredFields()); } /** * @covers ::__construct * @covers ::getHiddenFields * @covers ::getOptionalFields * @covers ::getRequiredFields */ public function testOverrides() { $fieldOverrides = new FieldOverrides([ AddressField::GIVEN_NAME => FieldOverride::HIDDEN, AddressField::ADDITIONAL_NAME => FieldOverride::HIDDEN, AddressField::FAMILY_NAME => FieldOverride::HIDDEN, AddressField::ORGANIZATION => FieldOverride::REQUIRED, AddressField::POSTAL_CODE => FieldOverride::OPTIONAL, ]); $this->assertSame([ AddressField::GIVEN_NAME, AddressField::ADDITIONAL_NAME, AddressField::FAMILY_NAME ], $fieldOverrides->getHiddenFields()); $this->assertSame([AddressField::POSTAL_CODE], $fieldOverrides->getOptionalFields()); $this->assertSame([AddressField::ORGANIZATION], $fieldOverrides->getRequiredFields()); } } __halt_compiler();----SIGNATURE:----FPi1j9xM3CMyoYp3tl2D4iH5rzgFpZadSDx44QgAOVZUygEE1ZzH/xAuPgexcR1w+io+iE9b7+yuAszQZy+3V6dvmGYM7VaQuKfVFI1I8KTU/DtrZNGkXNUQdyFLnoOdhROhG7NrFAyif4fa2dtT9VoGGlvLW50FVcLh7rFxFy5f5cP+ZcqicMVPu4+26cuBakuZjQXPaYIhtq5oodnCFy2KaByNaetiDn1L19oK2Zu5dJ47XbTRnq8jipHkdaXTfSDT/2GZOXMndBoe5Clp+7MuUMUXNtucZ4ly7eOZ0M9BHc6NPsv8lE0ihHwej0aeckxNewDRH9uA7BQ8DxEYeeQISn3BDhtsiI+OfrkPZZLAgPsHHqV1o2PgdhJSErWBx9m/EV+IgUofYyqF5kUr8u9KK68kazULBIaEV+lsKzYyBOFnf67Gj6vQTR26QvrLsBRSlt32SnEgCLhZa8NhgM/9+9C7Jhw2kJi2G5K7MNQeGRXmOvRNwNUSkcHoGUEIHyMuq4SnCT3Jw/iV9TE3d2rriH7MH4Q56UMgeSZCXtf2yaZJCh74WRH4WSyT52ehsyNO+TdDwAPou4smN601rskvxexEixxH7Z/2MAjdUK7VCl9shv3S3LOaQnc3n6q8QM10eN2Cbk/302FgROQ7+qjX7JH3LeJ+Qmh/DhwN3tY=----ATTACHMENT:----MzIxODEyMjczNDYwNzYzNyA5NDgxODUwNjE5MzMyNjAzIDQzNDY0NTIxMTY2OTY2MA==