public function testCreate() { $Faker = Factory::create(); $API = new API(); $Model = new Model(); $Model->setName($Faker->domainName . '/' . $Faker->word . '/' . $Faker->word); $this->mockResponse(200, $this->getMockData()); $Model = $API->create($Model, $Faker->userName, $Faker->password); $this->assertInstanceOf(Model::class, $Model); }
/** * @param Model $Model * @param $username * @param $passoword * * @return Model * @throws \DockerCloud\Exception */ public function create(Model $Model, $username, $passoword) { return new Model($this->getClient()->request('POST', $this->getAPINameSpace(), ['body' => $Model->toJson()])); }