Beispiel #1
0
 public function testFromArray()
 {
     $conversion = CMService_AdWords_Conversion::fromArray([]);
     $this->assertSame(null, $conversion->getId());
     $this->assertSame(null, $conversion->getLanguage());
     $this->assertSame(null, $conversion->getFormat());
     $this->assertSame(null, $conversion->getColor());
     $this->assertSame(null, $conversion->getLabel());
     $this->assertSame(null, $conversion->getRemarketingOnly());
     $this->assertSame(null, $conversion->getConversionValue());
     $this->assertSame(null, $conversion->getConversionCurrency());
     $this->assertSame(null, $conversion->getCustomParameterList());
     $conversion = CMService_AdWords_Conversion::fromArray(['google_conversion_id' => 123456, 'google_conversion_language' => 'en', 'google_conversion_format' => '1', 'google_conversion_color' => '666666', 'google_conversion_label' => 'label', 'google_remarketing_only' => true, 'google_conversion_value' => 123.0, 'google_conversion_currency' => 'USD', 'google_custom_params' => ['a' => 1, 'b' => 2]]);
     $this->assertSame(123456, $conversion->getId());
     $this->assertSame('en', $conversion->getLanguage());
     $this->assertSame('1', $conversion->getFormat());
     $this->assertSame('666666', $conversion->getColor());
     $this->assertSame('label', $conversion->getLabel());
     $this->assertSame(true, $conversion->getRemarketingOnly());
     $this->assertSame(123.0, $conversion->getConversionValue());
     $this->assertSame('USD', $conversion->getConversionCurrency());
     $this->assertSame(['a' => 1, 'b' => 2], $conversion->getCustomParameterList());
 }