Skip to content

Commit

Permalink
Prep release
Browse files Browse the repository at this point in the history
  • Loading branch information
Mark Scherer committed Feb 2, 2015
1 parent d1d92fb commit 9df781e
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 21 deletions.
31 changes: 31 additions & 0 deletions Test/Case/View/Helper/FormShimHelperTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?php

App::uses('FormShimHelper', 'Shim.View/Helper');
App::uses('ShimTestCase', 'Shim.TestSuite');
App::uses('View', 'View');

class FormShimHelperTest extends ShimTestCase {

public function setUp() {
$this->Form = new FormShimHelper(new View(null));

parent::setUp();
}

/**
* @return void
*/
public function testEnd() {
$result = $this->Form->end();
$this->assertSame('</form>', $result);
}

/**
* @expectedException PHPUNIT_FRAMEWORK_ERROR_DEPRECATED
* @return void
*/
public function testEndInvalid() {
$this->Form->end('Click me');
}

}
27 changes: 8 additions & 19 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -1,32 +1,18 @@
## Shim plugin Documentation

### Installation
usin composer and `composer require dereuromark/cakephp-shim:[version].*`:

```
"require": {
"dereuromark/cakephp-tools": "[version].*"
}
```
This will install the plugin into APP/Vendor.

Make sure you have `CakePlugin::load('Tools')` or `CakePlugin::loadAll()` in your bootstrap.

If you want to leverage the defaults regarding query strings, use
```
CakePlugin::load('Tools', ['bootstrap' => true]);
```
See [Setup docs](SETUP.md).

### Basics
To profit from the basics, you can extend the controller and model class and include the component.
```
```php
App::uses('ShimModel', 'Shim.Model');

class AppModel extends ShimModel {
}
```

```
```php
App::uses('ShimController', 'Shim.Controller');

class AppController extends ShimController {
Expand All @@ -38,15 +24,15 @@ class AppController extends ShimController {


For test cases you can extend the test case:
```
```php
App::uses('ShimTestCase', 'Shim.TestSuite');

class MyNameModelTest extends ShimTestCase {
}
```

For controller tests you can extend the 3.x backport of IntegrationTestCase:
```
```php
App::uses('ShimIntegrationTestCase', 'Shim.TestSuite');

class MyNameControllerTest extends ShimIntegrationTestCase {
Expand All @@ -57,6 +43,7 @@ class MyNameControllerTest extends ShimIntegrationTestCase {
$this->get(['controller' => 'my_name', 'action' => 'index']);
$this->assertResponseCode(200);
$this->assertNoRedirect();
$this->assertResponseContains('Some HTML snippet or text.');
}

public function testAddPost() {
Expand All @@ -73,6 +60,8 @@ class MyNameControllerTest extends ShimIntegrationTestCase {

}
```
This uses the same syntax as in 3.x then. When upgrading your 2.x app you will
not have to touch this much then. A real time saver when doing a lot of integration testing.

### Auth and Password Hashing
See [Auth](Auth.md)
Expand Down
4 changes: 2 additions & 2 deletions docs/SETUP.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ Installing the Plugin is pretty much as with every other CakePHP Plugin.

Install using Packagist/Composer:
```
composer require dereuromark/cakephp-shim:dev-master
composer require dereuromark/cakephp-shim:0.1.*
```

or manually via

```
"require": {
"dereuromark/cakephp-shim": "dev-master"
"dereuromark/cakephp-shim": "0.1.*"
}
```
and
Expand Down

0 comments on commit 9df781e

Please sign in to comment.