Skip to content

Commit

Permalink
Add test which reproduce the warning swagger-api#5338
Browse files Browse the repository at this point in the history
swagger-api#5338 (comment)
`[main] WARN io.swagger.codegen.languages.PhpClientCodegen - Type object not handled properly in setParameterExampleValue`
  • Loading branch information
ackintosh committed Oct 4, 2017
1 parent 90010da commit 3cb3254
Showing 1 changed file with 19 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package io.swagger.codegen.php;

import io.swagger.codegen.CodegenParameter;
import io.swagger.codegen.languages.PhpClientCodegen;

import org.testng.Assert;
import org.testng.annotations.Test;

public class PhpClientExampleTest {
@Test(description = "sets example value")
public void exampleValueTest() {
PhpClientCodegen clientCodegen = new PhpClientCodegen();
CodegenParameter p = new CodegenParameter();
p.baseType = "object";

clientCodegen.setParameterExampleValue(p);
Assert.assertEquals(p.example, "new \\stdClass");
}
}

0 comments on commit 3cb3254

Please sign in to comment.