Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support PHPUnit 6 #1238

Merged
merged 1 commit into from
Dec 19, 2017
Merged

Support PHPUnit 6 #1238

merged 1 commit into from
Dec 19, 2017

Conversation

carusogabriel
Copy link
Contributor

I use the PHPUnit\Framework\TestCase notation instead of PHPUnit_Framework_TestCase while extending our TestCases. This will help us migrate to PHPUnit 6, that no longer support snake case class names.

I just need to bump PHPUnit version to ^4.8.35 and ^5.7, that support this namespace.

@@ -7,8 +7,9 @@
use Symfony\Component\Console\Input\InputDefinition;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use PHPUnit\Framework\TestCase;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use classes must be in alphabetical order. Was expecting Symfony\Component\Console\Input\InputOption

@@ -3,13 +3,14 @@
namespace Test\Phinx\Config;

use \Phinx\Config\Config;
use PHPUnit\Framework\TestCase;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use classes must be in alphabetical order. Was expecting \Phinx\Config\Config

@@ -3,13 +3,14 @@
namespace Test\Phinx\Config;

use \Phinx\Config\Config;
use PHPUnit\Framework\TestCase;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use classes must be in alphabetical order. Was expecting \Phinx\Config\Config

@@ -3,13 +3,14 @@
namespace Test\Phinx\Config;

use \Phinx\Config\Config;
use PHPUnit\Framework\TestCase;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use classes must be in alphabetical order. Was expecting \Phinx\Config\Config

@@ -12,13 +12,14 @@
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Output\StreamOutput;
use Symfony\Component\Console\Tester\CommandTester;
use PHPUnit\Framework\TestCase;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use classes must be in alphabetical order. Was expecting Symfony\Component\Console\Tester\CommandTester

@@ -7,6 +7,7 @@
use Phinx\Db\Table\Index;
use Symfony\Component\Console\Input\ArrayInput;
use Symfony\Component\Console\Output\NullOutput;
use PHPUnit\Framework\TestCase;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use classes must be in alphabetical order. Was expecting Symfony\Component\Console\Output\NullOutput

@@ -8,8 +8,9 @@
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\BufferedOutput;
use Symfony\Component\Console\Output\NullOutput;
use PHPUnit\Framework\TestCase;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use classes must be in alphabetical order. Was expecting Symfony\Component\Console\Output\NullOutput

@@ -8,8 +8,9 @@
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\BufferedOutput;
use Symfony\Component\Console\Output\NullOutput;
use PHPUnit\Framework\TestCase;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use classes must be in alphabetical order. Was expecting Symfony\Component\Console\Output\NullOutput

@@ -5,8 +5,9 @@
use Phinx\Db\Adapter\SqlServerAdapter;
use Symfony\Component\Console\Input\ArrayInput;
use Symfony\Component\Console\Output\NullOutput;
use PHPUnit\Framework\TestCase;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use classes must be in alphabetical order. Was expecting Symfony\Component\Console\Output\NullOutput

@@ -9,8 +9,9 @@
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Output\StreamOutput;
use PHPUnit\Framework\TestCase;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use classes must be in alphabetical order. Was expecting Symfony\Component\Console\Output\StreamOutput

@@ -8,13 +8,14 @@
use Phinx\Console\PhinxApplication;
use Phinx\Migration\Manager;
use PHPUnit_Framework_MockObject_MockObject;
use PHPUnit\Framework\TestCase;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use classes must be in alphabetical order. Was expecting PHPUnit_Framework_MockObject_MockObject

@@ -8,13 +8,14 @@
use Phinx\Console\PhinxApplication;
use Phinx\Migration\Manager;
use PHPUnit_Framework_MockObject_MockObject;
use PHPUnit\Framework\TestCase;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use classes must be in alphabetical order. Was expecting PHPUnit_Framework_MockObject_MockObject

@@ -8,13 +8,14 @@
use Phinx\Console\PhinxApplication;
use Phinx\Migration\Manager;
use PHPUnit_Framework_MockObject_MockObject;
use PHPUnit\Framework\TestCase;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use classes must be in alphabetical order. Was expecting PHPUnit_Framework_MockObject_MockObject

@@ -8,13 +8,14 @@
use Phinx\Console\PhinxApplication;
use Phinx\Migration\Manager;
use PHPUnit_Framework_MockObject_MockObject;
use PHPUnit\Framework\TestCase;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use classes must be in alphabetical order. Was expecting PHPUnit_Framework_MockObject_MockObject

@@ -8,13 +8,14 @@
use Phinx\Console\PhinxApplication;
use Phinx\Migration\Manager;
use PHPUnit_Framework_MockObject_MockObject;
use PHPUnit\Framework\TestCase;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use classes must be in alphabetical order. Was expecting PHPUnit_Framework_MockObject_MockObject

@dereuromark
Copy link
Member

The leading \ for the other use statements is wrong and should be removed.

@codecov-io
Copy link

codecov-io commented Nov 11, 2017

Codecov Report

Merging #1238 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1238   +/-   ##
=======================================
  Coverage   74.61%   74.61%           
=======================================
  Files          35       35           
  Lines        4735     4735           
=======================================
  Hits         3533     3533           
  Misses       1202     1202

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f2f6181...2ca0955. Read the comment docs.

@carusogabriel carusogabriel changed the title Use PHPUnit\Framework\TestCase instead of PHPUnit_Framework_TestCase Support PHPUnit 6 Dec 9, 2017
@carusogabriel
Copy link
Contributor Author

I've added PHPUnit 6 support. This will help us test against PHP 7.2, that the each method was deprecated.

I added a setExpectedException method layer, because it was removed in PHPUnit 6.

@chinpei215 chinpei215 self-assigned this Dec 10, 2017
@@ -30,7 +30,7 @@
"symfony/yaml": "~2.8|~3.0|~4.0"
},
"require-dev": {
"phpunit/phpunit": "^4.8.26|^5.0",
"phpunit/phpunit": "^4.8.35|^5.7|^6.5",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it easier at some point if we would stop supporting completely outdated php version 5.4 and e.g. use 5.6+ instead?
Then we could drop 4.8 here probably at least.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's up to you. I've made everything to support all PHP and PHPUnit versions. But, I can open other PR dropping PHP 5.4 and 5.5 support 👨‍💻

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For now its cool then :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gonna work on stop supporting for PHP 5.4 and 5.5 versions soo.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I meant you dont have to. If all works fine :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ahh, okay, sorry 😅

@dereuromark dereuromark merged commit dd6f205 into cakephp:master Dec 19, 2017
@carusogabriel carusogabriel deleted the phpunit branch December 19, 2017 08:47
@chinpei215 chinpei215 removed their assignment Dec 20, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants