Initial
This commit is contained in:
54
tests/_support/View/SampleClass.php
Normal file
54
tests/_support/View/SampleClass.php
Normal file
@@ -0,0 +1,54 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This file is part of CodeIgniter 4 framework.
|
||||
*
|
||||
* (c) CodeIgniter Foundation <admin@codeigniter.com>
|
||||
*
|
||||
* For the full copyright and license information, please view
|
||||
* the LICENSE file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Tests\Support\View;
|
||||
|
||||
/**
|
||||
* Class SampleClass
|
||||
*
|
||||
* This class is only used to provide a reference point
|
||||
* during tests to make sure that things work as expected.
|
||||
*/
|
||||
class SampleClass
|
||||
{
|
||||
public function index()
|
||||
{
|
||||
return 'Hello World';
|
||||
}
|
||||
|
||||
public function hello()
|
||||
{
|
||||
return 'Hello';
|
||||
}
|
||||
|
||||
public function echobox($params)
|
||||
{
|
||||
if (is_array($params)) {
|
||||
$params = implode(',', $params);
|
||||
}
|
||||
|
||||
return $params;
|
||||
}
|
||||
|
||||
public static function staticEcho($params)
|
||||
{
|
||||
if (is_array($params)) {
|
||||
$params = implode(',', $params);
|
||||
}
|
||||
|
||||
return $params;
|
||||
}
|
||||
|
||||
public function work($p1, $p2, $p4)
|
||||
{
|
||||
return 'Right on';
|
||||
}
|
||||
}
|
||||
35
tests/_support/View/SampleClassWithInitController.php
Normal file
35
tests/_support/View/SampleClassWithInitController.php
Normal file
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This file is part of CodeIgniter 4 framework.
|
||||
*
|
||||
* (c) CodeIgniter Foundation <admin@codeigniter.com>
|
||||
*
|
||||
* For the full copyright and license information, please view
|
||||
* the LICENSE file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Tests\Support\View;
|
||||
|
||||
use CodeIgniter\HTTP\RequestInterface;
|
||||
use CodeIgniter\HTTP\ResponseInterface;
|
||||
use Psr\Log\LoggerInterface;
|
||||
|
||||
/**
|
||||
* Class SampleClassWithInitController
|
||||
*
|
||||
* This class is only used to provide a reference point
|
||||
* during tests to make sure that things work as expected.
|
||||
*/
|
||||
class SampleClassWithInitController
|
||||
{
|
||||
public function initController(RequestInterface $request, ResponseInterface $response, LoggerInterface $logger)
|
||||
{
|
||||
$this->response = $response;
|
||||
}
|
||||
|
||||
public function index()
|
||||
{
|
||||
return get_class($this->response);
|
||||
}
|
||||
}
|
||||
1
tests/_support/View/Views/simple.php
Normal file
1
tests/_support/View/Views/simple.php
Normal file
@@ -0,0 +1 @@
|
||||
<h1><?= $testString ?></h1>
|
||||
1
tests/_support/View/Views/simpler.php
Normal file
1
tests/_support/View/Views/simpler.php
Normal file
@@ -0,0 +1 @@
|
||||
<h1>{testString}</h1>
|
||||
1
tests/_support/View/Views/simples.php
Normal file
1
tests/_support/View/Views/simples.php
Normal file
@@ -0,0 +1 @@
|
||||
<h1><?= $testString ?? 'is_not' ?></h1>
|
||||
Reference in New Issue
Block a user