', ], [ [ 'key', [ 'a' ] ], 'a' ], [ [ 'key', [], 'code' ], '' ], [ [ 'key', [ new ScalarParam( ParamType::NUM, 1 ) ], 'code', [ 'value' => 1 ] ], '' . '1' . '{"value":1}' . '' ], ]; } /** @dataProvider provideConstruct */ public function testConstruct( $args, $expected ) { $mv = new DataMessageValue( ...$args ); $this->assertSame( $expected, $mv->dump() ); } /** @dataProvider provideConstruct */ public function testNew( $args, $expected ) { $mv = DataMessageValue::new( ...$args ); $this->assertSame( $expected, $mv->dump() ); } public function testGetCode() { $mv = new DataMessageValue( 'key', [], 'code' ); $this->assertSame( 'code', $mv->getCode() ); } public function testGetData() { $mv = new DataMessageValue( 'key', [], 'code', [ 'data' => 'foobar' ] ); $this->assertSame( [ 'data' => 'foobar' ], $mv->getData() ); } }