for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
require_once 'Intraface/Kernel.php';
require_once 'Intraface/DBQuery.php';
require_once 'Intraface/modules/cms/Page.php';
class FakeCMSPage extends CMS_Page
{
public $kernel;
public $cmssite;
public $dbquery;
function __construct($site)
$this->cmssite = $site;
$this->kernel = $site->kernel;
$this->dbquery = new Intraface_DBQuery($this->kernel, 'cms_page', 'cms_page.intranet_id = '.$this->kernel->intranet->get('id').' AND cms_page.active = 1 AND site_id = ' . $this->cmssite->get('id'));
}
function get()
return 1;
class FakeCMSSite
function __construct($kernel)
$this->kernel = $kernel;
class FakeCMSSection
function __construct($page)
$this->cmspage = $page;
cmspage
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
class MyClass { } $x = new MyClass(); $x->foo = true;
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:
class MyClass { public $foo; } $x = new MyClass(); $x->foo = true;
$this->kernel = $this->cmspage->kernel;
class FakeCMSTemplate
function __construct()
$this->kernel = new Stub_Kernel;
$this->cmssite = new FakeCMSSite($this->kernel);
cmssite
class FakeCMSTemplateSection
$this->site = $site;
site
return '';
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: