-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
32 changed files
with
497 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<?php | ||
/** | ||
* SCIC adapter using the json interface | ||
*/ | ||
class FACTFinder_Json66_ScicAdapter extends FACTFinder_Http_ScicAdapter | ||
{ | ||
/* SCIC is really not interface-specific. We just need an inheritance | ||
* chain because the action changes in FF 6.8. */ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<?php | ||
/** | ||
* SCIC adapter using the json interface | ||
*/ | ||
class FACTFinder_Json67_ScicAdapter extends FACTFinder_Json66_ScicAdapter | ||
{ | ||
/* no changes in FF 6.7 */ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<?php | ||
/** | ||
* SCIC adapter using the json interface | ||
*/ | ||
class FACTFinder_Json68_ScicAdapter extends FACTFinder_Json67_ScicAdapter | ||
{ | ||
protected function init() | ||
{ | ||
parent::init(); | ||
$this->getDataProvider()->setType('Tracking.ff'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<?php | ||
/** | ||
* SCIC adapter using the json interface | ||
*/ | ||
class FACTFinder_Json69_ScicAdapter extends FACTFinder_Json68_ScicAdapter | ||
{ | ||
/* no changes in FF 6.9 */ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<?php | ||
/** | ||
* SCIC adapter using the xml interface | ||
*/ | ||
class FACTFinder_Xml65_ScicAdapter extends FACTFinder_Http_ScicAdapter | ||
{ | ||
/* SCIC is really not interface-specific. We just need an inheritance | ||
* chain because the action changes in FF 6.8. */ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<?php | ||
/** | ||
* SCIC adapter using the xml interface | ||
*/ | ||
class FACTFinder_Xml66_ScicAdapter extends FACTFinder_Xml65_ScicAdapter | ||
{ | ||
/* no changes in FF 6.6 */ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<?php | ||
/** | ||
* SCIC adapter using the xml interface | ||
*/ | ||
class FACTFinder_Xml67_ScicAdapter extends FACTFinder_Xml66_ScicAdapter | ||
{ | ||
/* no changes in FF 6.7 */ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<?php | ||
/** | ||
* SCIC adapter using the xml interface | ||
*/ | ||
class FACTFinder_Xml68_ScicAdapter extends FACTFinder_Xml67_ScicAdapter | ||
{ | ||
protected function init() | ||
{ | ||
parent::init(); | ||
$this->getDataProvider()->setType('Tracking.ff'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<?php | ||
/** | ||
* SCIC adapter using the xml interface | ||
*/ | ||
class FACTFinder_Xml69_ScicAdapter extends FACTFinder_Xml68_ScicAdapter | ||
{ | ||
/* no changes in FF 6.9 */ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
<?php | ||
class JsonScicAdapter67Test extends PHPUnit_Framework_TestCase | ||
{ | ||
protected static $config; | ||
protected static $encodingHandler; | ||
protected static $paramsParser; | ||
protected static $log; | ||
|
||
protected $dataProvider; | ||
/** | ||
* @var FACTFinder_Http_ScicAdapter | ||
*/ | ||
protected $scicAdapter; | ||
|
||
public static function setUpBeforeClass() | ||
{ | ||
$zendConfig = FF::getSingleton('zend/config/xml', RESOURCES_DIR.DS.'config.xml', 'production'); | ||
self::$config = FF::getSingleton('configuration', $zendConfig); | ||
|
||
self::$log = FF::getInstance('log4PhpLogger'); | ||
self::$log->configure(RESOURCES_DIR.DS.'log4php.xml'); | ||
|
||
self::$encodingHandler = FF::getInstance('encodingHandler', self::$config, self::$log); | ||
self::$paramsParser = FF::getInstance('parametersParser', self::$config, self::$encodingHandler, self::$log); | ||
} | ||
|
||
public function setUp() | ||
{ | ||
|
||
$this->dataProvider = FF::getInstance('http/dummyProvider', self::$paramsParser->getServerRequestParams(), self::$config, self::$log); | ||
$this->dataProvider->setFileLocation(RESOURCES_DIR.DS.'responses'.DS.'json67'); | ||
$this->dataProvider->setFileExtension(".json"); | ||
$this->scicAdapter = FF::getInstance('json67/scicAdapter', $this->dataProvider, self::$paramsParser, self::$encodingHandler, self::$log); | ||
} | ||
|
||
public function testTrackClick() | ||
{ | ||
$result = $this->scicAdapter->trackClick( | ||
1, | ||
md5(2), | ||
'query', | ||
3, | ||
4, | ||
5, | ||
100, | ||
'product', | ||
9, | ||
15 | ||
); | ||
|
||
$this->assertTrue($result); | ||
} | ||
|
||
public function testTrackCart() | ||
{ | ||
$result = $this->scicAdapter->trackCart( | ||
1, | ||
md5(2), | ||
3, | ||
4.00, | ||
5 | ||
); | ||
|
||
$this->assertTrue($result); | ||
} | ||
|
||
public function testTrackCheckout() | ||
{ | ||
$result = $this->scicAdapter->trackCheckout( | ||
1, | ||
md5(2), | ||
3, | ||
4.00, | ||
5 | ||
); | ||
|
||
$this->assertTrue($result); | ||
} | ||
|
||
public function testTrackRecommendationClick() | ||
{ | ||
$result = $this->scicAdapter->trackRecommendationClick( | ||
1, | ||
md5(2), | ||
3 | ||
); | ||
|
||
$this->assertTrue($result); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
<?php | ||
class JsonScicAdapter68Test extends PHPUnit_Framework_TestCase | ||
{ | ||
protected static $config; | ||
protected static $encodingHandler; | ||
protected static $paramsParser; | ||
protected static $log; | ||
|
||
protected $dataProvider; | ||
/** | ||
* @var FACTFinder_Http_ScicAdapter | ||
*/ | ||
protected $scicAdapter; | ||
|
||
public static function setUpBeforeClass() | ||
{ | ||
$zendConfig = FF::getSingleton('zend/config/xml', RESOURCES_DIR.DS.'config.xml', 'production'); | ||
self::$config = FF::getSingleton('configuration', $zendConfig); | ||
|
||
self::$log = FF::getInstance('log4PhpLogger'); | ||
self::$log->configure(RESOURCES_DIR.DS.'log4php.xml'); | ||
|
||
self::$encodingHandler = FF::getInstance('encodingHandler', self::$config, self::$log); | ||
self::$paramsParser = FF::getInstance('parametersParser', self::$config, self::$encodingHandler, self::$log); | ||
} | ||
|
||
public function setUp() | ||
{ | ||
|
||
$this->dataProvider = FF::getInstance('http/dummyProvider', self::$paramsParser->getServerRequestParams(), self::$config, self::$log); | ||
$this->dataProvider->setFileLocation(RESOURCES_DIR.DS.'responses'.DS.'json68'); | ||
$this->dataProvider->setFileExtension(".json"); | ||
$this->scicAdapter = FF::getInstance('json68/scicAdapter', $this->dataProvider, self::$paramsParser, self::$encodingHandler, self::$log); | ||
} | ||
|
||
public function testTrackClick() | ||
{ | ||
$result = $this->scicAdapter->trackClick( | ||
1, | ||
md5(2), | ||
'query', | ||
3, | ||
4, | ||
5, | ||
100, | ||
'product', | ||
9, | ||
15 | ||
); | ||
|
||
$this->assertTrue($result); | ||
} | ||
|
||
public function testTrackCart() | ||
{ | ||
$result = $this->scicAdapter->trackCart( | ||
1, | ||
md5(2), | ||
3, | ||
4.00, | ||
5 | ||
); | ||
|
||
$this->assertTrue($result); | ||
} | ||
|
||
public function testTrackCheckout() | ||
{ | ||
$result = $this->scicAdapter->trackCheckout( | ||
1, | ||
md5(2), | ||
3, | ||
4.00, | ||
5 | ||
); | ||
|
||
$this->assertTrue($result); | ||
} | ||
|
||
public function testTrackRecommendationClick() | ||
{ | ||
$result = $this->scicAdapter->trackRecommendationClick( | ||
1, | ||
md5(2), | ||
3 | ||
); | ||
|
||
$this->assertTrue($result); | ||
} | ||
} |
Oops, something went wrong.