Repository: predictionio-sdk-php Updated Branches: refs/heads/PIO-163 c15f9fe3c -> 01fcc2236
Add ASF licenses Project: http://git-wip-us.apache.org/repos/asf/predictionio-sdk-php/repo Commit: http://git-wip-us.apache.org/repos/asf/predictionio-sdk-php/commit/8ceca260 Tree: http://git-wip-us.apache.org/repos/asf/predictionio-sdk-php/tree/8ceca260 Diff: http://git-wip-us.apache.org/repos/asf/predictionio-sdk-php/diff/8ceca260 Branch: refs/heads/PIO-163 Commit: 8ceca260f8703aedec0139f8e9083b08a658b90b Parents: c15f9fe Author: Donald Szeto <don...@apache.org> Authored: Wed Sep 12 10:35:46 2018 -0700 Committer: Donald Szeto <don...@apache.org> Committed: Wed Sep 12 10:35:46 2018 -0700 ---------------------------------------------------------------------- .travis.yml | 14 ++++++ build.xml | 15 ++++++ examples/ItemrankImport.php | 18 ++++++- examples/ItemrankQuery.php | 16 ++++++ examples/SampleEvent.php | 34 +++++++++---- phpunit.xml.dist | 15 ++++++ src/predictionio/BaseClient.php | 19 +++++++- src/predictionio/EngineClient.php | 15 ++++++ src/predictionio/EventClient.php | 67 ++++++++++++++++---------- src/predictionio/Exporter.php | 17 ++++++- src/predictionio/FileExporter.php | 17 ++++++- src/predictionio/PredictionIOAPIError.php | 16 ++++++ tests/Unit/EngineClientTest.php | 16 ++++++ tests/Unit/EventClientTest.php | 19 +++++++- tests/Unit/ExporterTest.php | 17 ++++++- tests/Unit/FileExporterTest.php | 17 ++++++- 16 files changed, 288 insertions(+), 44 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/predictionio-sdk-php/blob/8ceca260/.travis.yml ---------------------------------------------------------------------- diff --git a/.travis.yml b/.travis.yml index 1223ecf..859b53c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,3 +1,17 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. language: php php: - 7.2 http://git-wip-us.apache.org/repos/asf/predictionio-sdk-php/blob/8ceca260/build.xml ---------------------------------------------------------------------- diff --git a/build.xml b/build.xml index fdb6fcf..309634f 100644 --- a/build.xml +++ b/build.xml @@ -1,5 +1,20 @@ <?xml version="1.0" encoding="UTF-8"?> +<!-- +Licensed to the Apache Software Foundation (ASF) under one or more +contributor license agreements. See the NOTICE file distributed with +this work for additional information regarding copyright ownership. +The ASF licenses this file to You under the Apache License, Version 2.0 +(the "License"); you may not use this file except in compliance with +the License. You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +--> + <project name="predictionio" default="install-dependencies"> <target name="install-dependencies"> http://git-wip-us.apache.org/repos/asf/predictionio-sdk-php/blob/8ceca260/examples/ItemrankImport.php ---------------------------------------------------------------------- diff --git a/examples/ItemrankImport.php b/examples/ItemrankImport.php index 4266a7f..6d1c551 100644 --- a/examples/ItemrankImport.php +++ b/examples/ItemrankImport.php @@ -1,4 +1,20 @@ <?php + +/** + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + require_once("vendor/autoload.php"); use predictionio\EventClient; @@ -27,7 +43,7 @@ for ($u=1; $u<=10; $u++) { $response=$client->recordUserActionOnItem('view', $u, $i); print_r($response); } -} +} ?> http://git-wip-us.apache.org/repos/asf/predictionio-sdk-php/blob/8ceca260/examples/ItemrankQuery.php ---------------------------------------------------------------------- diff --git a/examples/ItemrankQuery.php b/examples/ItemrankQuery.php index 2d06346..7ad60ae 100644 --- a/examples/ItemrankQuery.php +++ b/examples/ItemrankQuery.php @@ -1,4 +1,20 @@ <?php + +/** + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + require_once("vendor/autoload.php"); use predictionio\EngineClient; http://git-wip-us.apache.org/repos/asf/predictionio-sdk-php/blob/8ceca260/examples/SampleEvent.php ---------------------------------------------------------------------- diff --git a/examples/SampleEvent.php b/examples/SampleEvent.php index b41fc07..01b4a6a 100644 --- a/examples/SampleEvent.php +++ b/examples/SampleEvent.php @@ -1,4 +1,20 @@ <?php + +/** + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + require_once("vendor/autoload.php"); use predictionio\EventClient; @@ -12,11 +28,11 @@ try { echo($response); // set user with event time - $response=$client->setUser(9, array('age'=>10), + $response=$client->setUser(9, array('age'=>10), '2014-01-01T10:20:30.400+08:00'); print_r($response); - // set user + // set user $response=$client->setUser(8, array('age'=>20, 'gender'=>'M')); print_r($response); @@ -27,21 +43,21 @@ try { // delete user $response=$client->deleteUser(9); print_r($response); - + // set item with event time - $response=$client->setItem(3, array('itypes'=>array('1')), + $response=$client->setItem(3, array('itypes'=>array('1')), '2013-12-20T05:15:25.350+08:00'); print_r($response); - // set item + // set item $response=$client->setItem(2, array('itypes'=>array('1'))); print_r($response); - // unset item + // unset item $response=$client->unsetItem(2, array('itypes'=>array('1'))); print_r($response); - // delete item + // delete item $response=$client->deleteItem(3, '2000-01-01T01:01:01.001+01:00'); print_r($response); @@ -56,11 +72,11 @@ try { 'entityId' => '8', 'properties' => array('prop1'=>1, 'prop2'=>2), )); - print_r($response); + print_r($response); // get event $response=$client->getEvent('U_7eotSbeeK0BwshqEfRFAAAAUm-8gOyjP3FR73aBFo'); - print_r($response); + print_r($response); } catch (PredictionIOAPIError $e) { echo $e->getMessage(); http://git-wip-us.apache.org/repos/asf/predictionio-sdk-php/blob/8ceca260/phpunit.xml.dist ---------------------------------------------------------------------- diff --git a/phpunit.xml.dist b/phpunit.xml.dist index d313305..80c60eb 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,5 +1,20 @@ <?xml version="1.0" encoding="UTF-8"?> +<!-- +Licensed to the Apache Software Foundation (ASF) under one or more +contributor license agreements. See the NOTICE file distributed with +this work for additional information regarding copyright ownership. +The ASF licenses this file to You under the Apache License, Version 2.0 +(the "License"); you may not use this file except in compliance with +the License. You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +--> + <phpunit colors="true" verbose="false" convertErrorsToExceptions="true" http://git-wip-us.apache.org/repos/asf/predictionio-sdk-php/blob/8ceca260/src/predictionio/BaseClient.php ---------------------------------------------------------------------- diff --git a/src/predictionio/BaseClient.php b/src/predictionio/BaseClient.php index ecec355..877ef44 100644 --- a/src/predictionio/BaseClient.php +++ b/src/predictionio/BaseClient.php @@ -1,5 +1,20 @@ <?php +/** + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + namespace predictionio; use GuzzleHttp\Client; @@ -17,7 +32,7 @@ abstract class BaseClient { * @param string $baseUrl Base URL to the server * @param float $timeout Timeout of the request in seconds. Use 0 to wait indefinitely * @param float $connectTimeout Number of seconds to wait while trying to connect to a server - */ + */ public function __construct($baseUrl, $timeout, $connectTimeout) { $this->baseUrl = $baseUrl; $this->client = new Client([ @@ -60,7 +75,7 @@ abstract class BaseClient { $response = $this->client->request($method, $url, $options); return json_decode($response->getBody(), true); } catch (ClientException $e) { - throw new PredictionIOAPIError($e->getMessage()); + throw new PredictionIOAPIError($e->getMessage()); } } } http://git-wip-us.apache.org/repos/asf/predictionio-sdk-php/blob/8ceca260/src/predictionio/EngineClient.php ---------------------------------------------------------------------- diff --git a/src/predictionio/EngineClient.php b/src/predictionio/EngineClient.php index f45ac35..258db0f 100644 --- a/src/predictionio/EngineClient.php +++ b/src/predictionio/EngineClient.php @@ -1,5 +1,20 @@ <?php +/** + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + namespace predictionio; /** http://git-wip-us.apache.org/repos/asf/predictionio-sdk-php/blob/8ceca260/src/predictionio/EventClient.php ---------------------------------------------------------------------- diff --git a/src/predictionio/EventClient.php b/src/predictionio/EventClient.php index df4286f..b8eb1e2 100644 --- a/src/predictionio/EventClient.php +++ b/src/predictionio/EventClient.php @@ -1,9 +1,24 @@ <?php +/** + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + namespace predictionio; use GuzzleHttp\Client; use \DateTime; - + /** * Client for connecting to an Event Server * @@ -19,7 +34,7 @@ class EventClient extends BaseClient { * @param float Timeout of the request in seconds. Use 0 to wait indefinitely * Default is 0. * @param float Number of seconds to wait while trying to connect to a server. - * Default is 5. + * Default is 5. */ public function __construct($accessKey, $baseUrl='http://localhost:7070', $timeout=0, $connectTimeout=5 ) { @@ -32,7 +47,7 @@ class EventClient extends BaseClient { $result = $eventTime; if (!isset($eventTime)) { $result = (new DateTime('NOW'))->format(self::DATE_TIME_FORMAT); - } + } return $result; } @@ -40,14 +55,14 @@ class EventClient extends BaseClient { /** * Set a user entity * - * @param int|string User Id + * @param int|string User Id * @param array Properties of the user entity to set * @param string Time of the event in ISO 8601 format * (e.g. 2014-09-09T16:17:42.937-08:00). * Default is the current time. * * @return string JSON response - * + * * @throws PredictionIOAPIError Request error */ public function setUser($uid, array $properties=array(), $eventTime=null) { @@ -70,20 +85,20 @@ class EventClient extends BaseClient { /** * Unset a user entity * - * @param int|string User Id + * @param int|string User Id * @param array Properties of the user entity to unset * @param string Time of the event in ISO 8601 format * (e.g. 2014-09-09T16:17:42.937-08:00). * Default is the current time. * * @return string JSON response - * + * * @throws PredictionIOAPIError Request error */ public function unsetUser($uid, array $properties, $eventTime=null) { $eventTime = $this->getEventTime($eventTime); - if (empty($properties)) - throw new PredictionIOAPIError('Specify at least one property'); + if (empty($properties)) + throw new PredictionIOAPIError('Specify at least one property'); $json = json_encode([ 'event' => '$unset', @@ -99,13 +114,13 @@ class EventClient extends BaseClient { /** * Delete a user entity * - * @param int|string User Id + * @param int|string User Id * @param string Time of the event in ISO 8601 format * (e.g. 2014-09-09T16:17:42.937-08:00). * Default is the current time. * * @return string JSON response - * + * * @throws PredictionIOAPIError Request error */ public function deleteUser($uid, $eventTime=null) { @@ -120,18 +135,18 @@ class EventClient extends BaseClient { return $this->sendRequest('POST', $this->eventUrl, $json); } - + /** * Set an item entity * - * @param int|string Item Id + * @param int|string Item Id * @param array Properties of the item entity to set * @param string Time of the event in ISO 8601 format * (e.g. 2014-09-09T16:17:42.937-08:00). * Default is the current time. * * @return string JSON response - * + * * @throws PredictionIOAPIError Request error */ public function setItem($iid, array $properties=array(), $eventTime=null) { @@ -151,20 +166,20 @@ class EventClient extends BaseClient { /** * Unset an item entity * - * @param int|string Item Id + * @param int|string Item Id * @param array Properties of the item entity to unset * @param string Time of the event in ISO 8601 format * (e.g. 2014-09-09T16:17:42.937-08:00). * Default is the current time. * * @return string JSON response - * + * * @throws PredictionIOAPIError Request error */ public function unsetItem($iid, array $properties, $eventTime=null) { $eventTime = $this->getEventTime($eventTime); if (empty($properties)) - throw new PredictionIOAPIError('Specify at least one property'); + throw new PredictionIOAPIError('Specify at least one property'); $json = json_encode([ 'event' => '$unset', 'entityType' => 'item', @@ -179,13 +194,13 @@ class EventClient extends BaseClient { /** * Delete an item entity * - * @param int|string Item Id + * @param int|string Item Id * @param string Time of the event in ISO 8601 format * (e.g. 2014-09-09T16:17:42.937-08:00). * Default is the current time. * * @return string JSON response - * + * * @throws PredictionIOAPIError Request error */ public function deleteItem($iid, $eventTime=null) { @@ -205,18 +220,18 @@ class EventClient extends BaseClient { * Record a user action on an item * * @param string Event name - * @param int|string User Id - * @param int|string Item Id + * @param int|string User Id + * @param int|string Item Id * @param array Properties of the event * @param string Time of the event in ISO 8601 format * (e.g. 2014-09-09T16:17:42.937-08:00). * Default is the current time. * * @return string JSON response - * + * * @throws PredictionIOAPIError Request error */ - public function recordUserActionOnItem($event, $uid, $iid, + public function recordUserActionOnItem($event, $uid, $iid, array $properties=array(), $eventTime=null) { $eventTime = $this->getEventTime($eventTime); @@ -240,7 +255,7 @@ class EventClient extends BaseClient { * @param array An array describing the event * * @return string JSON response - * + * * @throws PredictionIOAPIError Request error */ public function createEvent(array $data) { @@ -255,11 +270,11 @@ class EventClient extends BaseClient { * @param string Event ID * * @return string JSON response - * + * * @throws PredictionIOAPIError Request error */ public function getEvent($eventId) { - return $this->sendRequest('GET', + return $this->sendRequest('GET', "/events/$eventId.json?accessKey=$this->accessKey", ''); } } http://git-wip-us.apache.org/repos/asf/predictionio-sdk-php/blob/8ceca260/src/predictionio/Exporter.php ---------------------------------------------------------------------- diff --git a/src/predictionio/Exporter.php b/src/predictionio/Exporter.php index 35b7a03..3924a9b 100644 --- a/src/predictionio/Exporter.php +++ b/src/predictionio/Exporter.php @@ -1,5 +1,20 @@ <?php +/** + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + namespace predictionio; @@ -59,4 +74,4 @@ trait Exporter { $this->export($json); } -} \ No newline at end of file +} http://git-wip-us.apache.org/repos/asf/predictionio-sdk-php/blob/8ceca260/src/predictionio/FileExporter.php ---------------------------------------------------------------------- diff --git a/src/predictionio/FileExporter.php b/src/predictionio/FileExporter.php index d0ee711..227e649 100644 --- a/src/predictionio/FileExporter.php +++ b/src/predictionio/FileExporter.php @@ -1,5 +1,20 @@ <?php +/** + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + namespace predictionio; /** @@ -24,4 +39,4 @@ class FileExporter { public function close() { fclose($this->file); } -} \ No newline at end of file +} http://git-wip-us.apache.org/repos/asf/predictionio-sdk-php/blob/8ceca260/src/predictionio/PredictionIOAPIError.php ---------------------------------------------------------------------- diff --git a/src/predictionio/PredictionIOAPIError.php b/src/predictionio/PredictionIOAPIError.php index ca4cacd..a65d6a9 100644 --- a/src/predictionio/PredictionIOAPIError.php +++ b/src/predictionio/PredictionIOAPIError.php @@ -1,4 +1,20 @@ <?php + +/** + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + namespace predictionio; /** * Thrown when there is an error with the request. http://git-wip-us.apache.org/repos/asf/predictionio-sdk-php/blob/8ceca260/tests/Unit/EngineClientTest.php ---------------------------------------------------------------------- diff --git a/tests/Unit/EngineClientTest.php b/tests/Unit/EngineClientTest.php index 66c43b9..a389576 100644 --- a/tests/Unit/EngineClientTest.php +++ b/tests/Unit/EngineClientTest.php @@ -1,4 +1,20 @@ <?php + +/** + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + namespace predictionio\tests\Unit; use GuzzleHttp\Middleware; http://git-wip-us.apache.org/repos/asf/predictionio-sdk-php/blob/8ceca260/tests/Unit/EventClientTest.php ---------------------------------------------------------------------- diff --git a/tests/Unit/EventClientTest.php b/tests/Unit/EventClientTest.php index 7a463ff..7f3319e 100644 --- a/tests/Unit/EventClientTest.php +++ b/tests/Unit/EventClientTest.php @@ -1,4 +1,20 @@ <?php + +/** + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + namespace predictionio\tests\Unit; use GuzzleHttp\Client; @@ -91,7 +107,7 @@ class EventClientTest extends \PHPUnit_Framework_TestCase { public function testUnsetUserWithoutProperties() { $this->eventClient->unsetUser(1, array()); } - + public function testDeleteUser() { $this->eventClient->deleteUser(1); $result=array_shift($this->container); @@ -294,4 +310,3 @@ class EventClientTest extends \PHPUnit_Framework_TestCase { } ?> - http://git-wip-us.apache.org/repos/asf/predictionio-sdk-php/blob/8ceca260/tests/Unit/ExporterTest.php ---------------------------------------------------------------------- diff --git a/tests/Unit/ExporterTest.php b/tests/Unit/ExporterTest.php index fb2377b..bd36fe5 100644 --- a/tests/Unit/ExporterTest.php +++ b/tests/Unit/ExporterTest.php @@ -1,5 +1,20 @@ <?php +/** + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + namespace predictionio\tests\Unit; @@ -117,4 +132,4 @@ class ExporterTest extends \PHPUnit_Framework_TestCase { $this->assertTrue(preg_match($pattern, $json) === 1, 'json'); } -} \ No newline at end of file +} http://git-wip-us.apache.org/repos/asf/predictionio-sdk-php/blob/8ceca260/tests/Unit/FileExporterTest.php ---------------------------------------------------------------------- diff --git a/tests/Unit/FileExporterTest.php b/tests/Unit/FileExporterTest.php index f23affa..a088816 100644 --- a/tests/Unit/FileExporterTest.php +++ b/tests/Unit/FileExporterTest.php @@ -1,5 +1,20 @@ <?php +/** + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + namespace predictionio\tests\Unit; @@ -37,4 +52,4 @@ EOS; $this->assertEquals($expected, $exported); } -} \ No newline at end of file +}