Skip to content

Commit

Permalink
[#12379] - Docblocks
Browse files Browse the repository at this point in the history
  • Loading branch information
niden committed Dec 11, 2018
1 parent 924985f commit 8dd2ad6
Show file tree
Hide file tree
Showing 18 changed files with 313 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tests/_data/fixtures/Traits/BeanstalkTrait.php
@@ -1,4 +1,5 @@
<?php
declare(strict_types=1);

/**
* This file is part of the Phalcon Framework.
Expand All @@ -15,6 +16,11 @@
use UnitTester;
use function var_dump;

/**
* Trait BeanstalkTrait
*
* @package Phalcon\Test\Fixtures\Traits
*/
trait BeanstalkTrait
{
/**
Expand Down
6 changes: 6 additions & 0 deletions tests/_data/fixtures/Traits/Cache/FileTrait.php
@@ -1,4 +1,5 @@
<?php
declare(strict_types=1);

/**
* This file is part of the Phalcon Framework.
Expand All @@ -15,6 +16,11 @@
use Phalcon\Cache\Frontend\Data;
use function cacheFolder;

/**
* Trait FileTrait
*
* @package Phalcon\Test\Fixtures\Traits\Cache
*/
trait FileTrait
{
/**
Expand Down
1 change: 1 addition & 0 deletions tests/_data/fixtures/Traits/CollectionTrait.php
@@ -1,4 +1,5 @@
<?php
declare(strict_types=1);

/**
* This file is part of the Phalcon Framework.
Expand Down
6 changes: 6 additions & 0 deletions tests/_data/fixtures/Traits/ConfigTrait.php
@@ -1,4 +1,5 @@
<?php
declare(strict_types=1);

/**
* This file is part of the Phalcon Framework.
Expand All @@ -19,6 +20,11 @@
use Phalcon\Config\Adapter\Yaml;
use UnitTester;

/**
* Trait ConfigTrait
*
* @package Phalcon\Test\Fixtures\Traits
*/
trait ConfigTrait
{
/**
Expand Down
6 changes: 6 additions & 0 deletions tests/_data/fixtures/Traits/CookieTrait.php
@@ -1,4 +1,5 @@
<?php
declare(strict_types=1);

/**
* This file is part of the Phalcon Framework.
Expand All @@ -13,6 +14,11 @@

use RuntimeException;

/**
* Trait CookieTrait
*
* @package Phalcon\Test\Fixtures\Traits
*/
trait CookieTrait
{
/**
Expand Down
6 changes: 6 additions & 0 deletions tests/_data/fixtures/Traits/CryptTrait.php
@@ -1,4 +1,5 @@
<?php
declare(strict_types=1);

/**
* This file is part of the Phalcon Framework.
Expand All @@ -13,6 +14,11 @@

use UnitTester;

/**
* Trait CryptTrait
*
* @package Phalcon\Test\Fixtures\Traits
*/
trait CryptTrait
{
/**
Expand Down
6 changes: 6 additions & 0 deletions tests/_data/fixtures/Traits/Db/MysqlTrait.php
@@ -1,4 +1,5 @@
<?php
declare(strict_types=1);

/**
* This file is part of the Phalcon Framework.
Expand All @@ -15,6 +16,11 @@
use Phalcon\Db\Index;
use Phalcon\Db\Reference;

/**
* Trait MysqlTrait
*
* @package Phalcon\Test\Fixtures\Traits\Db
*/
trait MysqlTrait
{
protected $connection = null;
Expand Down
6 changes: 6 additions & 0 deletions tests/_data/fixtures/Traits/Db/PostgresqlTrait.php
@@ -1,4 +1,5 @@
<?php
declare(strict_types=1);

/**
* This file is part of the Phalcon Framework.
Expand All @@ -11,6 +12,11 @@

namespace Phalcon\Test\Fixtures\Traits\Db;

/**
* Trait PostgresqlTrait
*
* @package Phalcon\Test\Fixtures\Traits\Db
*/
trait PostgresqlTrait
{
protected $connection = null;
Expand Down
6 changes: 6 additions & 0 deletions tests/_data/fixtures/Traits/DiTrait.php
@@ -1,4 +1,5 @@
<?php
declare(strict_types=1);

/**
* This file is part of the Phalcon Framework.
Expand Down Expand Up @@ -38,6 +39,11 @@
use Phalcon\Session\Adapter\Files as FilesSession;
use function dataFolder;

/**
* Trait DiTrait
*
* @package Phalcon\Test\Fixtures\Traits
*/
trait DiTrait
{
/**
Expand Down
6 changes: 6 additions & 0 deletions tests/_data/fixtures/Traits/DialectTrait.php
@@ -1,4 +1,5 @@
<?php
declare(strict_types=1);

/**
* This file is part of the Phalcon Framework.
Expand All @@ -18,6 +19,11 @@
use Phalcon\Db\Index;
use Phalcon\Db\Reference;

/**
* Trait DialectTrait
*
* @package Phalcon\Test\Fixtures\Traits
*/
trait DialectTrait
{
/**
Expand Down
6 changes: 6 additions & 0 deletions tests/_data/fixtures/Traits/RedisTrait.php
@@ -1,4 +1,5 @@
<?php
declare(strict_types=1);

/**
* This file is part of the Phalcon Framework.
Expand All @@ -13,6 +14,11 @@

use UnitTester;

/**
* Trait RedisTrait
*
* @package Phalcon\Test\Fixtures\Traits
*/
trait RedisTrait
{
protected $options = [];
Expand Down
1 change: 1 addition & 0 deletions tests/_data/fixtures/Traits/RouterTrait.php
@@ -1,4 +1,5 @@
<?php
declare(strict_types=1);

/**
* This file is part of the Phalcon Framework.
Expand Down
141 changes: 141 additions & 0 deletions tests/_data/fixtures/Traits/TagHelperTrait.php
@@ -0,0 +1,141 @@
<?php
declare(strict_types=1);

/**
* This file is part of the Phalcon Framework.
*
* (c) Phalcon Team <team@phalconphp.com>
*
* For the full copyright and license information, please view the LICENSE.txt
* file that was distributed with this source code.
*/

namespace Phalcon\Test\Fixtures\Traits;

use Phalcon\Html\Tag;
use UnitTester;

/**
* Trait TagSetupTrait
*
* @package Phalcon\Test\Fixtures\Traits
*/
trait TagHelperTrait
{
/**
* Tests Phalcon\Tag :: input*()
*
* @author Phalcon Team <team@phalconphp.com>
* @since 2014-09-05
*/
public function tagField(UnitTester $I)
{
$I->wantToTest(sprintf('Tag - %s() - parameters', $this->function));
$tag = new Tag();
$tag->setDI($this->container);

$options = [
'class' => 'x_class',
];
$expected = '<input type="' . $this->inputType . '" id="x_name" name="x_name" class="x_class"';

$this->testFieldParameter($I, $tag, 'x_name', $this->function, $options, $expected);
$this->testFieldParameter($I, $tag, 'x_name', $this->function, $options, $expected, true);
}
//
// /**
// * Tests Phalcon\Tag :: input*() - parameters and id in it
// *
// * @author Phalcon Team <team@phalconphp.com>
// * @since 2014-09-05
// */
// public function tagFieldParameterWithId(UnitTester $I)
// {
// $I->wantToTest(sprintf('Tag - %s() - parameters with id', $this->function));
// $tag = new Tag();
// $tag->setDI($this->container);
//
// $options = [
// 'name' => 'x_name',
// 'id' => 'x_id',
// 'class' => 'x_class',
// 'size' => '10',
// ];
// $expected = '<input type="' . $this->inputType . '" id="x_id" name="x_name" '
// . 'class="x_class" size="10"';
//
// $this->testFieldParameter($I, $tag, $this->function, $options, $expected);
// $this->testFieldParameter($I, $tag, $this->function, $options, $expected, true);
// }
//
// /**
// * Tests Phalcon\Tag :: input*() - setDefault
// *
// * @author Phalcon Team <team@phalconphp.com>
// * @since 2014-09-05
// */
// public function tagFieldWithSetDefault(UnitTester $I)
// {
// $I->wantToTest(sprintf('Tag - %s() - setDefault()', $this->function));
// $tag = new Tag();
// $tag->setDI($this->container);
//
// $options = [
// 'name' => 'x_name',
// 'class' => 'x_class',
// 'size' => '10',
// ];
// $expected = '<input type="' . $this->inputType . '" id="x_name" '
// . 'name="x_name" value="x_value" class="x_class" size="10"';
//
// $this->testFieldParameter($I, $tag, $this->function, $options, $expected, false, 'setDefault');
// $this->testFieldParameter($I, $tag, $this->function, $options, $expected, true, 'setDefault');
// }
//
// /**
// * Tests Phalcon\Tag :: input*() - setDefault and element not present
// *
// * @author Phalcon Team <team@phalconphp.com>
// * @since 2014-09-05
// */
// public function tagFieldWithSetDefaultElementNotPresent(UnitTester $I)
// {
// $I->wantToTest(sprintf('Tag - %s() - setDefault() element not present', $this->function));
// $tag = new Tag();
// $tag->setDI($this->container);
//
// $options = [
// 'name' => 'x_name',
// 'class' => 'x_class',
// 'size' => '10',
// ];
// $expected = '<input type="' . $this->inputType . '" id="x_name" '
// . 'name="x_name" value="x_value" class="x_class" '
// . 'size="10"';
//
// $this->testFieldParameter($I, $tag, $this->function, $options, $expected, false, 'setDefault');
// $this->testFieldParameter($I, $tag, $this->function, $options, $expected, true, 'setDefault');
// }

/**
* Runs the test for a Tag::$function with $options
*
* @param \UnitTester $I
* @param string $name
* @param string $function
* @param mixed $options
* @param string $expected
* @param boolean $xhtml
* @param string $set
*/
abstract protected function testFieldParameter(
UnitTester $I,
Tag $tag,
string $name,
string $function,
$options,
string $expected,
bool $xhtml = false,
string $set = ''
);
}

0 comments on commit 8dd2ad6

Please sign in to comment.