Skip to content

Commit

Permalink
Merge branch 'release'
Browse files Browse the repository at this point in the history
  • Loading branch information
m-ender committed Dec 3, 2013
2 parents ec0f3f2 + df5030e commit 6c8588c
Show file tree
Hide file tree
Showing 32 changed files with 497 additions and 6 deletions.
5 changes: 4 additions & 1 deletion CHANGELOG.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
Version 2.5.5
CHG: SCIC adapters now exist for all versions (and both interfaces), because the action changes in FF 6.8.

Version 2.5.4
FIX: build the slider base URL the correct way (it's not ensured the empty parameter is at the end)
FIX: all events must have a source ref key except of session start
FIX: accept the navigation parameter as it is accepted with FF6.9

Version 2.5.3
FIX: accept the navigation parameter as it is accepted with FF6.9
FIX: added missing $this on setupEventTracking execution
Expand Down
2 changes: 1 addition & 1 deletion build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<project name="FACT-Finder PHP Framework" default="build">

<property name="version" value="2.5.4" override="true" />
<property name="version" value="2.5.5" override="true" />
<property name="buildBaseDir" value="./build" override="true" />
<property name="packageName" value="FACTFinderPHPFramework" override="true" />
<property name="srcdir" value="${project.basedir}" override="true" />
Expand Down
8 changes: 4 additions & 4 deletions lib/FACTFinder/Http/DataProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ public function setArrayParam($name, $values)
{
$this->urlBuilder->setArrayParam($name, $values);
}

/**
* this implementation of the data provider uses the type as request path in addition to the request context path.
* please ensure that this is the full action name, i.e. "Search.ff"
Expand Down Expand Up @@ -174,15 +174,15 @@ public function getData()
}
return $this->data;
}

/**
* sets the URL that was used for the most recent request
**/
public function setPreviousUrl($url)
{
$this->previousUrl = $url;
}

/**
* checks whether the URL (and thus the parameters) have changed since last loading the data
**/
Expand Down Expand Up @@ -320,4 +320,4 @@ public function getLastCurlErrno()
*
* @package FACTFinder\Http
*/
class NoRequestTypeException extends Exception {}
class NoRequestTypeException extends Exception {}
9 changes: 9 additions & 0 deletions lib/FACTFinder/Json66/ScicAdapter.php
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. */
}
8 changes: 8 additions & 0 deletions lib/FACTFinder/Json67/ScicAdapter.php
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 */
}
12 changes: 12 additions & 0 deletions lib/FACTFinder/Json68/ScicAdapter.php
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');
}
}
8 changes: 8 additions & 0 deletions lib/FACTFinder/Json69/ScicAdapter.php
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 */
}
9 changes: 9 additions & 0 deletions lib/FACTFinder/Xml65/ScicAdapter.php
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. */
}
8 changes: 8 additions & 0 deletions lib/FACTFinder/Xml66/ScicAdapter.php
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 */
}
8 changes: 8 additions & 0 deletions lib/FACTFinder/Xml67/ScicAdapter.php
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 */
}
12 changes: 12 additions & 0 deletions lib/FACTFinder/Xml68/ScicAdapter.php
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');
}
}
8 changes: 8 additions & 0 deletions lib/FACTFinder/Xml69/ScicAdapter.php
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 */
}
90 changes: 90 additions & 0 deletions tests/JsonScicAdapter67Test.php
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);
}
}
90 changes: 90 additions & 0 deletions tests/JsonScicAdapter68Test.php
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);
}
}
Loading

0 comments on commit 6c8588c

Please sign in to comment.