Exemplo n.º 1
0
 /**
  * Test method.
  *
  * @covers ElKuKu\Crowdin\Package\File::update
  * @covers ElKuKu\Crowdin\Package\File::processLanguageFile
  *
  * @return void
  */
 public function testUpdate()
 {
     $languageFile = new Languagefile(__DIR__ . '/Data/test.txt', 'crowdinpath');
     $languageFile->setTitle('title');
     $languageFile->setExportPattern('pattern');
     $expected = 'project/{projectID}/update-file?key={APIKey}&multipart%5B0%5D%5Bname%5D=branch' . '&multipart%5B0%5D%5Bcontents%5D=branch&multipart%5B1%5D%5Bname%5D=files%5Bcrowdinpath%5D' . '&multipart%5B2%5D%5Bname%5D=titles%5Bcrowdinpath%5D&multipart%5B2%5D%5Bcontents%5D=title' . '&multipart%5B3%5D%5Bname%5D=export_patterns%5Bcrowdinpath%5D&multipart%5B3%5D%5Bcontents%5D=pattern';
     $this->assertThat($this->object->update($languageFile, 'branch'), $this->equalTo($this->testResponse->setBody($expected)));
 }
Exemplo n.º 2
0
 /**
  * Test method.
  *
  * @covers ElKuKu\Crowdin\Languagefile::getTitle
  *
  * @return void
  */
 public function testGetTitle()
 {
     $this->object->setTitle('fooBar');
     $this->assertThat($this->object->getTitle(), $this->equalTo('fooBar'));
 }