Skip to content

Commit

Permalink
Start making progress on deprecations and behavior changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
markstory committed Jul 25, 2023
1 parent b56e0ac commit 6a8570e
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 2 deletions.
9 changes: 9 additions & 0 deletions config/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
use Cake\Datasource\ConnectionManager;
use Cake\Error\ErrorTrap;
use Cake\Error\ExceptionTrap;
use Cake\Http\ServerRequest;
use Cake\Log\Log;
use Cake\Mailer\Mailer;
use Cake\Mailer\TransportFactory;
Expand Down Expand Up @@ -162,3 +163,11 @@
Security::setSalt((string)Configure::consume('Security.salt'));

\Sentry\init(Configure::consume('Sentry'));

// Default value as inertia plugin only sets this when inertia is used,
ServerRequest::addDetector('inertia', function () {
return false;
});
ServerRequest::addDetector('inertia-partial-data', function () {
return false;
});
5 changes: 5 additions & 0 deletions src/Controller/SubtasksController.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
namespace App\Controller;

use App\Model\Entity\Task;
use App\Model\Table\SubtasksTable;
use App\Model\Table\TasksTable;
use Cake\View\JsonView;
use InvalidArgumentException;

Expand All @@ -15,6 +17,9 @@
*/
class SubtasksController extends AppController
{
public TasksTable $Tasks;
public SubtasksTable $Subtasks;

public function initialize(): void
{
parent::initialize();
Expand Down
1 change: 1 addition & 0 deletions src/Service/CalendarServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ public function services(ContainerInterface $container): void
{
$container->add(GoogleClient::class, function () {
$file = file_get_contents(ROOT . '/config/google-auth.json');
assert($file !== false, 'Could not read config/google-auth.json');
$config = json_decode($file, true);

$client = new GoogleClient();
Expand Down
3 changes: 3 additions & 0 deletions tests/TestCase/Controller/GoogleOauthControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
namespace App\Test\TestCase\Controller;

use App\Controller\GoogleOauthController;
use App\Model\Table\CalendarProvidersTable;
use App\Test\TestCase\FactoryTrait;
use Cake\TestSuite\IntegrationTestTrait;
use Cake\TestSuite\TestCase;
Expand All @@ -18,6 +19,8 @@ class GoogleOauthControllerTest extends TestCase
use FactoryTrait;
use IntegrationTestTrait;

protected CalendarProvidersTable $CalendarProviders;

/**
* @var array
*/
Expand Down
3 changes: 3 additions & 0 deletions tests/TestCase/Controller/ProjectsControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

namespace App\Test\TestCase\Controller;

use App\Model\Table\ProjectsTable;
use App\Test\TestCase\FactoryTrait;
use Cake\TestSuite\IntegrationTestTrait;
use Cake\TestSuite\TestCase;
Expand All @@ -17,6 +18,8 @@ class ProjectsControllerTest extends TestCase
use FactoryTrait;
use IntegrationTestTrait;

public ProjectsTable $Projects;

/**
* Fixtures
*
Expand Down
6 changes: 4 additions & 2 deletions tests/TestCase/Controller/UsersControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@

namespace App\Test\TestCase\Controller;

use App\Model\Table\UsersTable;
use App\Test\TestCase\FactoryTrait;
use Cake\I18n\FrozenTime;
use Cake\ORM\TableRegistry;
use Cake\TestSuite\EmailTrait;
use Cake\TestSuite\IntegrationTestTrait;
use Cake\TestSuite\TestCase;
Expand All @@ -21,6 +21,8 @@ class UsersControllerTest extends TestCase
use EmailTrait;
use IntegrationTestTrait;

public UsersTable $Users;

/**
* Fixtures
*
Expand All @@ -34,7 +36,7 @@ class UsersControllerTest extends TestCase
public function setUp(): void
{
parent::setUp();
$this->Users = TableRegistry::get('Users');
$this->Users = $this->fetchTable('Users');
}

public function testLogin()
Expand Down

0 comments on commit 6a8570e

Please sign in to comment.