-
Notifications
You must be signed in to change notification settings - Fork 295
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Upgrade to CakePHP 5 - Fixing types and unit tests
- Loading branch information
1 parent
f8d2463
commit c827746
Showing
43 changed files
with
78 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,7 +15,7 @@ | |
|
||
use Cake\Core\Configure; | ||
use Cake\Http\ServerRequest; | ||
use Cake\Mailer\Email; | ||
use Cake\Mailer\Mailer; | ||
use Cake\Mailer\TransportFactory; | ||
use Cake\TestSuite\TestCase; | ||
|
||
|
@@ -26,7 +26,7 @@ class SocialAccountsControllerTest extends TestCase | |
* | ||
* @var array | ||
*/ | ||
public $fixtures = [ | ||
protected array $fixtures = [ | ||
'plugin.CakeDC/Users.SocialAccounts', | ||
'plugin.CakeDC/Users.Users', | ||
]; | ||
|
@@ -46,9 +46,9 @@ public function setUp(): void | |
Configure::write('Users.RememberMe.active', false); | ||
|
||
TransportFactory::setConfig('test', ['className' => 'Debug']); | ||
$this->configEmail = Email::getConfig('default'); | ||
Email::drop('default'); | ||
Email::setConfig('default', [ | ||
$this->configEmail = Mailer::getConfig('default'); | ||
Mailer::drop('default'); | ||
Mailer::setConfig('default', [ | ||
'transport' => 'test', | ||
'from' => '[email protected]', | ||
]); | ||
|
@@ -69,9 +69,9 @@ public function setUp(): void | |
*/ | ||
public function tearDown(): void | ||
{ | ||
Email::drop('default'); | ||
Mailer::drop('default'); | ||
TransportFactory::drop('test'); | ||
//Email::setConfig('default', $this->configEmail); | ||
//Mailer::setConfig('default', $this->configEmail); | ||
|
||
Configure::write('Opauth', $this->configOpauth); | ||
Configure::write('Users.RememberMe.active', $this->configRememberMe); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,7 +21,8 @@ | |
use Cake\Controller\ComponentRegistry; | ||
use Cake\Controller\Controller; | ||
use Cake\Event\Event; | ||
use Cake\Mailer\Email; | ||
use Cake\Http\ServerRequest; | ||
use Cake\Mailer\Mailer; | ||
use Cake\Mailer\TransportFactory; | ||
use Cake\ORM\Entity; | ||
use Cake\ORM\TableRegistry; | ||
|
@@ -42,7 +43,7 @@ abstract class BaseTraitTest extends TestCase | |
* | ||
* @var array | ||
*/ | ||
public $fixtures = [ | ||
protected array $fixtures = [ | ||
'plugin.CakeDC/Users.Users', | ||
]; | ||
|
||
|
@@ -85,6 +86,7 @@ public function setUp(): void | |
try { | ||
$this->Trait = $this->getMockBuilder($this->traitClassName) | ||
->setMethods($traitMockMethods) | ||
->setConstructorArgs([new ServerRequest()]) | ||
->getMock(); | ||
$this->Trait->expects($this->any()) | ||
->method('getUsersTable') | ||
|
@@ -98,9 +100,9 @@ public function setUp(): void | |
TransportFactory::setConfig('test', [ | ||
'className' => 'Debug', | ||
]); | ||
$this->configEmail = Email::getConfig('default'); | ||
Email::drop('default'); | ||
Email::setConfig('default', [ | ||
$this->configEmail = Mailer::getConfig('default'); | ||
Mailer::drop('default'); | ||
Mailer::setConfig('default', [ | ||
'transport' => 'test', | ||
'from' => '[email protected]', | ||
]); | ||
|
@@ -116,9 +118,9 @@ public function tearDown(): void | |
{ | ||
unset($this->table, $this->Trait); | ||
if ($this->mockDefaultEmail) { | ||
Email::drop('default'); | ||
Mailer::drop('default'); | ||
TransportFactory::drop('test'); | ||
//Email::setConfig('default', $this->setConfigEmail); | ||
//Mailer::setConfig('default', $this->setConfigEmail); | ||
} | ||
parent::tearDown(); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.