Skip to content

Commit

Permalink
Add test for previous commit.
Browse files Browse the repository at this point in the history
  • Loading branch information
ADmad committed Feb 16, 2018
1 parent a0d6635 commit d668bc1
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tests/TestCase/Form/FormTest.php
Expand Up @@ -16,6 +16,8 @@

use Cake\Form\Form;
use Cake\TestSuite\TestCase;
use TestApp\Form\AppForm;
use TestApp\Form\FormSchema;

/**
* Form test case.
Expand All @@ -39,6 +41,9 @@ public function testSchema()
$schema = $this->getMockBuilder('Cake\Form\Schema')->getMock();
$this->assertSame($schema, $form->schema($schema));
$this->assertSame($schema, $form->schema());

$form = new AppForm();
$this->assertInstanceOf(FormSchema::class, $form->schema());
}

/**
Expand Down
22 changes: 22 additions & 0 deletions tests/test_app/TestApp/Form/AppForm.php
@@ -0,0 +1,22 @@
<?php
/**
* CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
* Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
*
* Licensed under The MIT License
* For full copyright and license information, please see the LICENSE.txt
* Redistributions of files must retain the above copyright notice.
*
* @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
* @link https://cakephp.org CakePHP(tm) Project
* @since 3.5.13
* @license https://opensource.org/licenses/mit-license.php MIT License
*/
namespace TestApp\Form;

use Cake\Form\Form;

class AppForm extends Form
{
protected $_schemaClass = FormSchema::class;
}
24 changes: 24 additions & 0 deletions tests/test_app/TestApp/Form/FormSchema.php
@@ -0,0 +1,24 @@
<?php
/**
* CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
* Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
*
* Licensed under The MIT License
* For full copyright and license information, please see the LICENSE.txt
* Redistributions of files must retain the above copyright notice.
*
* @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
* @link https://cakephp.org CakePHP(tm) Project
* @since 3.5.13
* @license https://opensource.org/licenses/mit-license.php MIT License
*/
namespace TestApp\Form;

use Cake\Form\Schema;

/**
* Contains the schema information for Form instances.
*/
class FormSchema extends Schema
{
}

0 comments on commit d668bc1

Please sign in to comment.