Skip to content

Instantly share code, notes, and snippets.

View ppeiris's full-sized avatar
🏋️‍♂️
Working on machine learning projects

Prabath Peiris ppeiris

🏋️‍♂️
Working on machine learning projects
View GitHub Profile
{
"address": {
"address1": "2916 SE 125th Ave 36",
"address2": " sdf",
"city": "Portland.",
"state": "OR",
"zip": "97236",
"country": "USA"
}
<?php
/****** IN THE MODULE.CONFIG.PHP (ZF-HAL SECTION) ***********************************/
'AccountsApi\\V1\\Rest\\Utility\\UtilityEntity' => array(
//'identifier_name' => 'id',
'route_name' => 'AccountsApi.rest.accounts.utility',
//'hydrator' => 'ArraySerializable',
'hydrator' => 'AccountsApi\\V1\\Rest\\Hydrators\\UtilityEntityHydrate',
),
# Codeception Test Suite Configuration
# suite for acceptance tests.
# perform tests in browser using the WebDriver or PhpBrowser.
# (tip: that's what your customer will see).
# (tip: test your ajax and javascript only with WebDriver).
class_name: WebGuy
modules:
enabled:
<?php
public function onBootstrap(MvcEvent $event)
{
$eventManager = $event->getApplication()->getEventManager();
$eventManager->attach(MvcEvent::EVENT_DISPATCH_ERROR, array($this, 'catchApi404Error'), 1000);
}
public function catchApi404Error(MvcEvent $e)
<?php
public function onBootstrap(MvcEvent $event)
{
$eventManager = $event->getApplication()->getEventManager();
$eventManager->attach(MvcEvent::EVENT_ROUTE, array($this, 'apiTestAuth'), -100);
}
public function apiTestAuth(MvcEvent $event)
<?php
namespace AccountServiceTest;
use Zend\Loader\AutoloaderFactory;
use Zend\Mvc\Service\ServiceManagerConfig;
use Zend\ServiceManager\ServiceManager;
use RuntimeException;
error_reporting(E_ALL | E_STRICT);
<?php
namespace AccountServiceTest\Service;
use PHPUnit_Framework_TestCase;
use AccountService\Service\Accounts as Accounts;
class AccountsServiceTest extends PHPUnit_Framework_TestCase {
public $sm;
public $login;
public $entityManager;
<?php
namespace AccountServiceTest;
use Zend\Loader\AutoloaderFactory;
use Zend\Mvc\Service\ServiceManagerConfig;
use Zend\ServiceManager\ServiceManager;
use RuntimeException;
error_reporting(E_ALL | E_STRICT);
var RootRouter = Backbone.Router.extend({
routes: {
"acllist": "showAclRules",
"aclresources": "showAclResources",
},
initialize: function () {
//console.log('initialize');
//this.AclListModel = new AclListModel();
<?php
/**** config.php *****/
'hydrators' => array(
'invokables' => array(
'UserEntityHydrater' => 'UsersApi\\V1\\Rest\\Hydrators\\UserEntityHydrate',
),
),