Skip to content

Commit

Permalink
make test case compatible with phpunit 6 (#1)
Browse files Browse the repository at this point in the history
* make test case compatible with phpunit 6

* fix: undefined function `snake_case`

* fix: remove Type declarations
  • Loading branch information
gweecl authored and hebbet committed Sep 13, 2019
1 parent 8cf04bc commit 2d53693
Show file tree
Hide file tree
Showing 10 changed files with 14 additions and 13 deletions.
3 changes: 2 additions & 1 deletion src/AdvancedCustomFields.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use Corcel\Acf\Exception\MissingFieldNameException;
use Corcel\Model;
use Illuminate\Support\Str;

/**
* Class AdvancedCustomFields.
Expand Down Expand Up @@ -53,7 +54,7 @@ public function __call($name, $arguments)
throw new MissingFieldNameException('The field name is missing');
}

$field = FieldFactory::make($arguments[0], $this->post, snake_case($name));
$field = FieldFactory::make($arguments[0], $this->post, Str::snake($name));

return $field ? $field->get() : null;
}
Expand Down
4 changes: 2 additions & 2 deletions tests/BasicFieldsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
*
* @author Junior Grossi <[email protected]>
*/
class BasicFieldsTest extends PHPUnit_Framework_TestCase
class BasicFieldsTest extends PHPUnit\Framework\TestCase
{
/**
* @var Post
Expand All @@ -18,7 +18,7 @@ class BasicFieldsTest extends PHPUnit_Framework_TestCase
/**
* Setup a base $this->post object to represent the page with the basic fields.
*/
protected function setUp()
public function setUp()
{
$this->post = Post::find(11); // it' a page with the custom fields
}
Expand Down
2 changes: 1 addition & 1 deletion tests/ChoicesFieldsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
*
* @author Junior Grossi <[email protected]>
*/
class ChoicesFieldsTest extends PHPUnit_Framework_TestCase
class ChoicesFieldsTest extends PHPUnit\Framework\TestCase
{
/**
* @var Post
Expand Down
4 changes: 2 additions & 2 deletions tests/ContentFieldsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
*
* @author Junior Grossi <[email protected]>
*/
class ContentFieldsTest extends PHPUnit_Framework_TestCase
class ContentFieldsTest extends PHPUnit\Framework\TestCase
{
/**
* @var Post
Expand All @@ -21,7 +21,7 @@ class ContentFieldsTest extends PHPUnit_Framework_TestCase
/**
* Setup a base $this->post object to represent the page with the content fields.
*/
protected function setUp()
public function setUp()
{
$this->post = Post::find(21); // it' a page with the custom fields
}
Expand Down
2 changes: 1 addition & 1 deletion tests/CorcelIntegrationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*
* @author Junior Grossi <[email protected]>
*/
class CorcelIntegrationTest extends PHPUnit_Framework_TestCase
class CorcelIntegrationTest extends PHPUnit\Framework\TestCase
{
public function testIfCorcelIntegrationIsWorking()
{
Expand Down
4 changes: 2 additions & 2 deletions tests/EmptyBasicFieldsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
*
* @author Junior Grossi <[email protected]>
*/
class EmptyBasicFieldsTest extends PHPUnit_Framework_TestCase
class EmptyBasicFieldsTest extends PHPUnit\Framework\TestCase
{
/**
* @var Post
Expand All @@ -19,7 +19,7 @@ class EmptyBasicFieldsTest extends PHPUnit_Framework_TestCase
/**
* Setup a base $this->post object to represent the page with the basic fields.
*/
protected function setUp()
public function setUp()
{
$this->post = Post::find(91); // it' a page with empty custom fields
}
Expand Down
2 changes: 1 addition & 1 deletion tests/FieldFactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
*
* @author Junior Grossi <[email protected]>
*/
class FieldFactoryTest extends PHPUnit_Framework_TestCase
class FieldFactoryTest extends PHPUnit\Framework\TestCase
{
public function testInvalidFieldName()
{
Expand Down
2 changes: 1 addition & 1 deletion tests/JqueryFieldsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
use Corcel\Acf\Field\Text;
use Corcel\Model\Post;

class JqueryFieldsTests extends PHPUnit_Framework_TestCase
class JqueryFieldsTests extends PHPUnit\Framework\TestCase
{
/**
* @var Post
Expand Down
2 changes: 1 addition & 1 deletion tests/LayoutFieldsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
*
* @author Junior Grossi <[email protected]>
*/
class LayoutFieldsTest extends PHPUnit_Framework_TestCase
class LayoutFieldsTest extends PHPUnit\Framework\TestCase
{
public function testRepeaterField()
{
Expand Down
2 changes: 1 addition & 1 deletion tests/RelationalFieldsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
*
* @author Junior Grossi <[email protected]>
*/
class RelationalFieldsTests extends PHPUnit_Framework_TestCase
class RelationalFieldsTests extends PHPUnit\Framework\TestCase
{
/**
* @var Post
Expand Down

0 comments on commit 2d53693

Please sign in to comment.