Exemplo n.º 1
0
 /**
  * Test method.
  *
  * @covers ElKuKu\Crowdin\Languageproject::toQuery
  *
  * @return void
  */
 public function testToQuery()
 {
     $this->object->name = '{name}';
     $this->object->languages = ['{a}', '{b}'];
     $expected = [['name' => 'name', 'contents' => '{name}'], ['name' => 'languages[]', 'contents' => '{a}'], ['name' => 'languages[]', 'contents' => '{b}']];
     $this->assertThat($this->object->toQuery(), $this->equalTo($expected));
 }
Exemplo n.º 2
0
 /**
  * Edit Crowdin project.
  *
  * @param   Languageproject  $project  The language project object.
  *
  * @see https://crowdin.com/page/api/edit-project
  * @since 1.0.7
  *
  * @return \Psr\Http\Message\ResponseInterface
  */
 public function edit(Languageproject $project)
 {
     $project->identifier = null;
     $project->source_language = null;
     return $this->getHttpClient()->post($this->getBasePath('edit-project'), ['multipart' => $project->toQuery()]);
 }