GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

DocumentLiteralWrappedTest   A
last analyzed

Complexity

Total Complexity 16

Size/Duplication

Total Lines 374
Duplicated Lines 56.95 %

Coupling/Cohesion

Components 1
Dependencies 6

Importance

Changes 0
Metric Value
wmc 16
lcom 1
cbo 6
dl 213
loc 374
rs 10
c 0
b 0
f 0

16 Methods

Rating   Name   Duplication   Size   Complexity  
A setUp() 0 5 1
A shouldReturnCorrectBindingStyle() 0 8 1
A shouldReturnCorrectBindingUse() 0 8 1
A shouldParseArrayWithSimpleType() 16 16 1
A shouldParseSimpleObject() 19 19 1
B shouldParseObjectWithWrapper() 28 28 1
B shouldParseObjectWithArrayOfElement() 24 24 1
A shouldParseArrayOfObjects() 21 21 1
B shouldParseObjectWithArrayOfWrapper() 0 28 1
A shouldParseReturnArrayWithSimpleType() 15 15 1
A shouldParseReturnSimpleObject() 18 18 1
B shouldParseReturnObjectWithWrapper() 28 28 1
B shouldParseReturnObjectWithArrayOfElement() 24 24 1
A shouldParseReturnArrayOfObjects() 20 20 1
B shouldParseReturnObjectWithArrayOfWrapper() 0 28 1
A shouldParseWhenMultipleWrappers() 0 16 1

How to fix   Duplicated Code   

Duplicated Code

Duplicate code is one of the most pungent code smells. A rule that is often used is to re-structure code once it is duplicated in three or more places.

Common duplication problems, and corresponding solutions are:

1
<?php
2
/**
3
 * Copyright (C) 2013-2015
4
 * Piotr Olaszewski <[email protected]>
5
 *
6
 * Permission is hereby granted, free of charge, to any person obtaining a copy
7
 * of this software and associated documentation files (the "Software"), to deal
8
 * in the Software without restriction, including without limitation the rights
9
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
 * copies of the Software, and to permit persons to whom the Software is
11
 * furnished to do so, subject to the following conditions:
12
 *
13
 * The above copyright notice and this permission notice shall be included in
14
 * all copies or substantial portions of the Software.
15
 *
16
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
 * SOFTWARE.
23
 */
24
25
use Factory\ParameterFactory;
26
use Ouzo\Tests\Assert;
27
use WSDL\XML\Styles\DocumentLiteralWrapped;
28
29
/**
30
 * DocumentLiteralWrappedTest
31
 *
32
 * @author Piotr Olaszewski <[email protected]>
33
 */
34
class DocumentLiteralWrappedTest extends PHPUnit_Framework_TestCase
0 ignored issues
show
Coding Style Compatibility introduced by
PSR1 recommends that each class must be in a namespace of at least one level to avoid collisions.

You can fix this by adding a namespace to your class:

namespace YourVendor;

class YourClass { }

When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.

Loading history...
35
{
36
    /**
37
     * @var DocumentLiteralWrapped
38
     */
39
    private $_documentLiteralWrapped;
40
41
    protected function setUp()
42
    {
43
        parent::setUp();
44
        $this->_documentLiteralWrapped = new DocumentLiteralWrapped();
45
    }
46
47
    /**
48
     * @test
49
     */
50
    public function shouldReturnCorrectBindingStyle()
51
    {
52
        //when
53
        $style = $this->_documentLiteralWrapped->bindingStyle();
54
55
        //then
56
        $this->assertEquals('document', $style);
57
    }
58
59
    /**
60
     * @test
61
     */
62
    public function shouldReturnCorrectBindingUse()
63
    {
64
        //when
65
        $style = $this->_documentLiteralWrapped->bindingUse();
66
67
        //then
68
        $this->assertEquals('literal', $style);
69
    }
70
71
    /**
72
     * @test
73
     */
74 View Code Duplication
    public function shouldParseArrayWithSimpleType()
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
75
    {
76
        //given
77
        $method = ParameterFactory::createParameterForSimpleArray('method');
78
79
        //when
80
        $types = $this->_documentLiteralWrapped->typeParameters($method);
81
82
        //then
83
        $type = $types[0];
84
        // convention 4, input wrapper element name should match with Operation name
85
        $this->assertEquals('method', $type->getName());
86
        $this->assertEquals(array(array('type' => 'type', 'value' => 'ns:ArrayOfNames', 'name' => 'names', 'optional' => false)), $type->getElementAttributes());
87
        Assert::thatArray($type->getComplex())->onMethod('getName')->containsExactly('ArrayOfNames');
88
        Assert::thatArray($type->getComplex())->onMethod('getArrayType')->containsExactly('xsd:string[]');
89
    }
90
91
    /**
92
     * @test
93
     */
94 View Code Duplication
    public function shouldParseSimpleObject()
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
95
    {
96
        //given
97
        $parameter = ParameterFactory::createParameterForSimpleObject('method');
98
99
        //when
100
        $types = $this->_documentLiteralWrapped->typeParameters($parameter);
101
102
        //then
103
        $type = $types[0];
104
        $this->assertEquals('method', $type->getName());
105
        $this->assertEquals(array(array('type' => 'element', 'value' => 'ns:Info', 'name' => 'info', 'optional' => false)), $type->getElementAttributes());
106
        Assert::thatArray($type->getComplex())->onMethod('getName')->containsExactly('Info');
107
        Assert::thatArray($type->getComplex())->onMethod('getElementAttributes')
108
            ->containsKeyAndValue(array(array(
109
                array('type' => 'type', 'value' => 'xsd:string', 'name' => 'name', 'optional' => false),
110
                array('type' => 'type', 'value' => 'xsd:int', 'name' => 'age', 'optional' => false)
111
            )));
112
    }
113
114
    /**
115
     * @test
116
     */
117 View Code Duplication
    public function shouldParseObjectWithWrapper()
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
118
    {
119
        //given
120
        $parameter = ParameterFactory::createParameterForObjectWithWrapper('method');
121
122
        //when
123
        $types = $this->_documentLiteralWrapped->typeParameters($parameter);
124
125
        //then
126
        $type = $types[0];
127
        $this->assertEquals('method', $type->getName());
128
        $this->assertEquals(array(
129
            array('type' => 'element', 'value' => 'ns:AgentNameWithId', 'name' => 'agentNameWithId', 'optional' => false)
130
        ), $type->getElementAttributes());
131
        $complexActual = $type->getComplex();
132
        Assert::thatArray($complexActual)->onMethod('getName')->containsExactly('AgentNameWithId');
133
        Assert::thatArray($complexActual)->onMethod('getElementAttributes')
134
            ->containsKeyAndValue(array(array(
135
                array('type' => 'element', 'value' => 'ns:MocksMockUserWrapper', 'name' => 'agent', 'optional' => false),
136
                array('type' => 'type', 'value' => 'xsd:int', 'name' => 'id', 'optional' => false)
137
            )));
138
        Assert::thatArray($complexActual[0]->getComplex())->onMethod('getElementAttributes')
139
            ->containsKeyAndValue(array(array(
140
                array('type' => 'type', 'value' => 'xsd:int', 'name' => 'id', 'optional' => false),
141
                array('type' => 'type', 'value' => 'xsd:string', 'name' => 'name', 'optional' => false),
142
                array('type' => 'type', 'value' => 'xsd:int', 'name' => 'age', 'optional' => false)
143
            )));
144
    }
145
146
    /**
147
     * @test
148
     */
149 View Code Duplication
    public function shouldParseObjectWithArrayOfElement()
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
150
    {
151
        //given
152
        $parameter = ParameterFactory::createParameterForObjectWithArrayOfSimpleType('method');
153
154
        //when
155
        $types = $this->_documentLiteralWrapped->typeParameters($parameter);
156
157
        //then
158
        $type = $types[0];
159
        $this->assertEquals('method', $type->getName());
160
        $this->assertEquals(array(
161
            array('type' => 'element', 'value' => 'ns:NamesInfo', 'name' => 'namesInfo', 'optional' => false)
162
        ), $type->getElementAttributes());
163
        $actualContext = $type->getComplex();
164
        Assert::thatArray($actualContext)->onMethod('getName')->containsExactly('NamesInfo');
165
        Assert::thatArray($actualContext)->onMethod('getElementAttributes')
166
            ->containsKeyAndValue(array(array(
167
                array('type' => 'type', 'value' => 'ns:ArrayOfNames', 'name' => 'names', 'optional' => false),
168
                array('type' => 'type', 'value' => 'xsd:int', 'name' => 'id', 'optional' => false)
169
            )));
170
        Assert::thatArray($actualContext[0]->getComplex())->onMethod('getName')->containsExactly('ArrayOfNames');
171
        Assert::thatArray($actualContext[0]->getComplex())->onMethod('getArrayType')->containsExactly('xsd:string[]');
172
    }
173
174
    /**
175
     * @test
176
     */
177 View Code Duplication
    public function shouldParseArrayOfObjects()
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
178
    {
179
        //given
180
        $parameter = ParameterFactory::createParameterForArrayOfObjects('method');
181
182
        //when
183
        $types = $this->_documentLiteralWrapped->typeParameters($parameter);
184
185
        //then
186
        $type = $types[0];
187
        $this->assertEquals('method', $type->getName());
188
        $this->assertEquals(array(array('type' => 'type', 'value' => 'ns:ArrayOfCompanies', 'name' => 'companies', 'optional' => false)), $type->getElementAttributes());
189
        $actualContext = $type->getComplex();
190
        Assert::thatArray($actualContext)->onMethod('getName')->containsExactly('ArrayOfCompanies');
191
        Assert::thatArray($actualContext)->onMethod('getArrayType')->containsExactly('ns:Companies[]');
192
        $this->assertEquals('Companies', $actualContext[0]->getComplex()->getName());
193
        $this->assertEquals(array(
194
            array('type' => 'type', 'value' => 'xsd:string', 'name' => 'name', 'optional' => false),
195
            array('type' => 'type', 'value' => 'xsd:int', 'name' => 'id', 'optional' => false)
196
        ), $actualContext[0]->getComplex()->getElementAttributes());
197
    }
198
199
    /**
200
     * @test
201
     */
202
    public function shouldParseObjectWithArrayOfWrapper()
203
    {
204
        //given
205
        $parameter = ParameterFactory::createParameterObjectWithArrayOfWrapper('method');
206
207
        //when
208
        $types = $this->_documentLiteralWrapped->typeParameters($parameter);
209
210
        //then
211
        $type = $types[0];
212
        $this->assertEquals('method', $type->getName());
213
        $this->assertEquals(array(array('type' => 'element', 'value' => 'ns:ListOfAgents', 'name' => 'listOfAgents', 'optional' => false)), $type->getElementAttributes());
214
        $actualContext = $type->getComplex();
215
        Assert::thatArray($actualContext)->onMethod('getName')->containsExactly('ListOfAgents');
216
        $this->assertEquals(array(
217
            array('type' => 'type', 'value' => 'ns:ArrayOfAgents', 'name' => 'agents', 'optional' => false),
218
            array('type' => 'type', 'value' => 'xsd:int', 'name' => 'id', 'optional' => false)
219
        ), $actualContext[0]->getElementAttributes());
220
        Assert::thatArray($actualContext[0]->getComplex())->onMethod('getName')->containsExactly('ArrayOfAgents');
221
        Assert::thatArray($actualContext[0]->getComplex())->onMethod('getArrayType')->containsExactly('ns:MocksMockUserWrapper[]');
222
        $actualComplex2 = $actualContext[0]->getComplex();
223
        $this->assertEquals('MocksMockUserWrapper', $actualComplex2[0]->getComplex()->getName());
224
        $this->assertEquals(array(
225
            array('type' => 'type', 'value' => 'xsd:int', 'name' => 'id', 'optional' => false),
226
            array('type' => 'type', 'value' => 'xsd:string', 'name' => 'name', 'optional' => false),
227
            array('type' => 'type', 'value' => 'xsd:int', 'name' => 'age', 'optional' => false)
228
        ), $actualComplex2[0]->getComplex()->getElementAttributes());
229
    }
230
231
    /**
232
     * @test
233
     */
234 View Code Duplication
    public function shouldParseReturnArrayWithSimpleType()
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
235
    {
236
        //given
237
        $method = ParameterFactory::createReturnForSimpleArray('method');
238
239
        //when
240
        $element = $this->_documentLiteralWrapped->typeReturning($method);
241
242
        //then
243
        // convention 4, input wrapper element name should match with Operation name
244
        $this->assertEquals('methodResponse', $element->getName());
245
        $this->assertEquals(array(array('type' => 'type', 'value' => 'ns:ArrayOfNames', 'name' => 'names', 'optional' => false)), $element->getElementAttributes());
246
        Assert::thatArray($element->getComplex())->onMethod('getName')->containsExactly('ArrayOfNames');
247
        Assert::thatArray($element->getComplex())->onMethod('getArrayType')->containsExactly('xsd:string[]');
248
    }
249
250
    /**
251
     * @test
252
     */
253 View Code Duplication
    public function shouldParseReturnSimpleObject()
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
254
    {
255
        //given
256
        $parameter = ParameterFactory::createReturnForSimpleObject('method');
257
258
        //when
259
        $element = $this->_documentLiteralWrapped->typeReturning($parameter);
260
261
        //then
262
        $this->assertEquals('methodResponse', $element->getName());
263
        $this->assertEquals(array(array('type' => 'element', 'value' => 'ns:Info', 'name' => 'info', 'optional' => false)), $element->getElementAttributes());
264
        Assert::thatArray($element->getComplex())->onMethod('getName')->containsExactly('Info');
265
        Assert::thatArray($element->getComplex())->onMethod('getElementAttributes')
266
            ->containsKeyAndValue(array(array(
267
                array('type' => 'type', 'value' => 'xsd:string', 'name' => 'name', 'optional' => false),
268
                array('type' => 'type', 'value' => 'xsd:int', 'name' => 'age', 'optional' => false)
269
            )));
270
    }
271
272
    /**
273
     * @test
274
     */
275 View Code Duplication
    public function shouldParseReturnObjectWithWrapper()
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
276
    {
277
        //given
278
        $parameter = ParameterFactory::createReturnForObjectWithWrapper('method');
279
280
        //when
281
        $element = $this->_documentLiteralWrapped->typeReturning($parameter);
282
283
        //then
284
        $this->assertEquals('methodResponse', $element->getName());
285
        $this->assertEquals(array(
286
            array('type' => 'element', 'value' => 'ns:AgentNameWithId', 'name' => 'agentNameWithId', 'optional' => false)
287
        ), $element->getElementAttributes());
288
        $actualComplex = $element->getComplex();
289
        Assert::thatArray($actualComplex)->onMethod('getName')->containsExactly('AgentNameWithId');
290
        Assert::thatArray($actualComplex)->onMethod('getElementAttributes')
291
            ->containsKeyAndValue(array(array(
292
                array('type' => 'element', 'value' => 'ns:MocksMockUserWrapper', 'name' => 'agent', 'optional' => false),
293
                array('type' => 'type', 'value' => 'xsd:int', 'name' => 'id', 'optional' => false)
294
            )));
295
        $actualComplex2 = $actualComplex[0]->getComplex();
296
        Assert::thatArray($actualComplex2)->onMethod('getElementAttributes')
297
            ->containsKeyAndValue(array(array(
298
                array('type' => 'type', 'value' => 'xsd:int', 'name' => 'id', 'optional' => false),
299
                array('type' => 'type', 'value' => 'xsd:string', 'name' => 'name', 'optional' => false),
300
                array('type' => 'type', 'value' => 'xsd:int', 'name' => 'age', 'optional' => false)
301
            )));
302
    }
303
304
    /**
305
     * @test
306
     */
307 View Code Duplication
    public function shouldParseReturnObjectWithArrayOfElement()
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
308
    {
309
        //given
310
        $parameter = ParameterFactory::createReturnForObjectWithArrayOfSimpleType('method');
311
312
        //when
313
        $element = $this->_documentLiteralWrapped->typeReturning($parameter);
314
315
        //then
316
        $this->assertEquals('methodResponse', $element->getName());
317
        $this->assertEquals(array(
318
            array('type' => 'element', 'value' => 'ns:NamesInfo', 'name' => 'namesInfo', 'optional' => false)
319
        ), $element->getElementAttributes());
320
321
        $actualComplex = $element->getComplex();
322
        Assert::thatArray($actualComplex)->onMethod('getName')->containsExactly('NamesInfo');
323
        Assert::thatArray($actualComplex)->onMethod('getElementAttributes')
324
            ->containsKeyAndValue(array(array(
325
                array('type' => 'type', 'value' => 'ns:ArrayOfNames', 'name' => 'names', 'optional' => false),
326
                array('type' => 'type', 'value' => 'xsd:int', 'name' => 'id', 'optional' => false)
327
            )));
328
        Assert::thatArray($actualComplex[0]->getComplex())->onMethod('getName')->containsExactly('ArrayOfNames');
329
        Assert::thatArray($actualComplex[0]->getComplex())->onMethod('getArrayType')->containsExactly('xsd:string[]');
330
    }
331
332
    /**
333
     * @test
334
     */
335 View Code Duplication
    public function shouldParseReturnArrayOfObjects()
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
336
    {
337
        //given
338
        $parameter = ParameterFactory::createReturnForArrayOfObjects('method');
339
340
        //when
341
        $element = $this->_documentLiteralWrapped->typeReturning($parameter);
342
343
        //then
344
        $this->assertEquals('methodResponse', $element->getName());
345
        $this->assertEquals(array(array('type' => 'type', 'value' => 'ns:ArrayOfCompanies', 'name' => 'companies', 'optional' => false)), $element->getElementAttributes());
346
        $actualComplex = $element->getComplex();
347
        Assert::thatArray($actualComplex)->onMethod('getName')->containsExactly('ArrayOfCompanies');
348
        Assert::thatArray($actualComplex)->onMethod('getArrayType')->containsExactly('ns:Companies[]');
349
        $this->assertEquals('Companies', $actualComplex[0]->getComplex()->getName());
350
        $this->assertEquals(array(
351
            array('type' => 'type', 'value' => 'xsd:string', 'name' => 'name', 'optional' => false),
352
            array('type' => 'type', 'value' => 'xsd:int', 'name' => 'id', 'optional' => false)
353
        ), $actualComplex[0]->getComplex()->getElementAttributes());
354
    }
355
356
    /**
357
     * @test
358
     */
359
    public function shouldParseReturnObjectWithArrayOfWrapper()
360
    {
361
        //given
362
        $parameter = ParameterFactory::createReturnObjectWithArrayOfWrapper('method');
363
364
        //when
365
        $element = $this->_documentLiteralWrapped->typeReturning($parameter);
366
367
        //then
368
        $this->assertEquals('methodResponse', $element->getName());
369
        $this->assertEquals(array(array('type' => 'element', 'value' => 'ns:ListOfAgents', 'name' => 'listOfAgents', 'optional' => false)), $element->getElementAttributes());
370
        $actualComplex = $element->getComplex();
371
        Assert::thatArray($actualComplex)->onMethod('getName')->containsExactly('ListOfAgents');
372
        Assert::thatArray($actualComplex)->onMethod('getElementAttributes')
373
            ->containsKeyAndValue(array(array(
374
                array('type' => 'type', 'value' => 'ns:ArrayOfAgents', 'name' => 'agents', 'optional' => false),
375
                array('type' => 'type', 'value' => 'xsd:int', 'name' => 'id', 'optional' => false)
376
            )));
377
        $actualComplex2 = $actualComplex[0]->getComplex();
378
        $this->assertEquals('ArrayOfAgents', $actualComplex2[0]->getName());
379
        $this->assertEquals('ns:MocksMockUserWrapper[]', $actualComplex2[0]->getArrayType());
380
        $this->assertEquals('MocksMockUserWrapper', $actualComplex2[0]->getComplex()->getName());
381
        $this->assertEquals(array(
382
            array('type' => 'type', 'value' => 'xsd:int', 'name' => 'id', 'optional' => false),
383
            array('type' => 'type', 'value' => 'xsd:string', 'name' => 'name', 'optional' => false),
384
            array('type' => 'type', 'value' => 'xsd:int', 'name' => 'age', 'optional' => false)
385
        ), $actualComplex2[0]->getComplex()->getElementAttributes());
386
    }
387
388
    /**
389
     * @test
390
     */
391
    public function shouldParseWhenMultipleWrappers()
392
    {
393
        //given
394
        $parameter = ParameterFactory::createParameterWithMultipleWrappers('method');
395
396
        //when
397
        $types = $this->_documentLiteralWrapped->typeParameters($parameter);
398
399
        //then
400
        $element = $types[0];
401
        Assert::thatArray($element->getElementAttributes())->containsKeyAndValue(array(
402
            array('type' => 'element', 'value' => 'ns:MocksWrapperClassCustomer', 'name' => 'customer', 'optional' => false),
403
            array('type' => 'element', 'value' => 'ns:MocksWrapperClassPurchase', 'name' => 'purchase', 'optional' => false)
404
        ));
405
        Assert::thatArray($element->getComplex())->onMethod('getName')->containsOnly("MocksWrapperClassCustomer", "MocksWrapperClassPurchase");
406
    }
407
}
408