コード例 #1
0
ファイル: ConversionTest.php プロジェクト: cargomedia/cm
 public function testGetSet()
 {
     $conversion = new CMService_AdWords_Conversion();
     $this->assertSame(null, $conversion->getColor());
     $conversion->setColor('666666');
     $this->assertSame('666666', $conversion->getColor());
     $conversion->setColor(null);
     $this->assertSame(null, $conversion->getColor());
     $this->assertSame(null, $conversion->getConversionCurrency());
     $conversion->setConversionCurrency('USD');
     $this->assertSame('USD', $conversion->getConversionCurrency());
     $conversion->setConversionCurrency(null);
     $this->assertSame(null, $conversion->getConversionCurrency());
     $this->assertSame(null, $conversion->getConversionValue());
     $conversion->setConversionValue(123);
     $this->assertSame(123.0, $conversion->getConversionValue());
     $conversion->setConversionValue(null);
     $this->assertSame(null, $conversion->getConversionValue());
     $this->assertSame(null, $conversion->getCustomParameterList());
     $conversion->setCustomParameterList(['a' => 1, 'b' => 2]);
     $this->assertSame(['a' => 1, 'b' => 2], $conversion->getCustomParameterList());
     $conversion->setCustomParameterList(null);
     $this->assertSame(null, $conversion->getCustomParameterList());
     $this->assertSame(null, $conversion->getCustomParameter('a'));
     $this->assertSame(null, $conversion->getCustomParameter('b'));
     $this->assertSame(null, $conversion->getCustomParameterList());
     $conversion->setCustomParameter('a', 1);
     $this->assertSame(1, $conversion->getCustomParameter('a'));
     $this->assertSame(null, $conversion->getCustomParameter('b'));
     $this->assertSame(['a' => 1], $conversion->getCustomParameterList());
     $conversion->setCustomParameter('b', 2);
     $this->assertSame(1, $conversion->getCustomParameter('a'));
     $this->assertSame(2, $conversion->getCustomParameter('b'));
     $this->assertSame(['a' => 1, 'b' => 2], $conversion->getCustomParameterList());
     $conversion->setCustomParameter('a', null);
     $this->assertSame(null, $conversion->getCustomParameter('a'));
     $this->assertSame(2, $conversion->getCustomParameter('b'));
     $this->assertSame(['b' => 2], $conversion->getCustomParameterList());
     $conversion->setCustomParameter('b', null);
     $this->assertSame(null, $conversion->getCustomParameter('a'));
     $this->assertSame(null, $conversion->getCustomParameter('b'));
     $this->assertSame(null, $conversion->getCustomParameterList());
     $this->assertSame(null, $conversion->getFormat());
     $conversion->setFormat('1');
     $this->assertSame('1', $conversion->getFormat());
     $conversion->setFormat(null);
     $this->assertSame(null, $conversion->getFormat());
     $this->assertSame(null, $conversion->getId());
     $conversion->setId(123456);
     $this->assertSame(123456, $conversion->getId());
     $conversion->setId(null);
     $this->assertSame(null, $conversion->getId());
     $this->assertSame(null, $conversion->getLabel());
     $conversion->setLabel('label');
     $this->assertSame('label', $conversion->getLabel());
     $conversion->setLabel(null);
     $this->assertSame(null, $conversion->getLabel());
     $this->assertSame(null, $conversion->getLanguage());
     $conversion->setLanguage('en');
     $this->assertSame('en', $conversion->getLanguage());
     $conversion->setLanguage(null);
     $this->assertSame(null, $conversion->getLanguage());
     $this->assertSame(null, $conversion->getRemarketingOnly());
     $conversion->setRemarketingOnly(true);
     $this->assertSame(true, $conversion->getRemarketingOnly());
     $conversion->setRemarketingOnly(false);
     $this->assertSame(false, $conversion->getRemarketingOnly());
     $conversion->setRemarketingOnly(null);
     $this->assertSame(null, $conversion->getRemarketingOnly());
 }