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

PagesTableTestで「Attempt to read property "useSubDomain" on array」のWarningが発生 #3026

Closed
kouki-miura2 opened this issue Jan 14, 2024 · 1 comment
Assignees
Labels
Todo 実行確定タスク

Comments

@kouki-miura2
Copy link

概要

86f1b95 時点のdev-5ブランチで
./vendor/bin/phpunit ./plugins/baser-core/tests/TestCase/Model/Table/PagesTableTest.phpを実行した所、下記のWarningが発生しました。

環境:
baserCMS version : 5.0.7
Docker Desktop for Windows (バージョン 4.26.1)

./vendor/bin/phpunit ./plugins/baser-core/tests/TestCase/Model/Table/PagesTableTest.php

PHPUnit 9.6.15 by Sebastian Bergmann and contributors.

..IIIIIIIIIIwarning: 2 :: Attempt to read property "useSubDomain" on array on line 209 of /var/www/html/plugins/baser-core/src/Model/Table/PagesTable.php
Stack Trace:

BaserCore\Model\Table\PagesTable::createSearchIndex() /var/www/html/plugins/baser-core/src/Model/Table/PagesTable.php, line 209
BaserCore\Test\TestCase\Model\Table\PagesTableTest::testCreateSearchIndex() /var/www/html/plugins/baser-core/tests/TestCase/Model/Table/PagesTableTest.php, line 174
PHPUnit\Framework\TestCase::runTest() /var/www/html/vendor/phpunit/phpunit/src/Framework/TestCase.php, line 1612
PHPUnit\Framework\TestCase::runBare() /var/www/html/vendor/phpunit/phpunit/src/Framework/TestCase.php, line 1218
PHPUnit\Framework\TestResult::run() /var/www/html/vendor/phpunit/phpunit/src/Framework/TestResult.php, line 728
PHPUnit\Framework\TestCase::run() /var/www/html/vendor/phpunit/phpunit/src/Framework/TestCase.php, line 968
PHPUnit\Framework\TestSuite::run() /var/www/html/vendor/phpunit/phpunit/src/Framework/TestSuite.php, line 684
PHPUnit\TextUI\TestRunner::run() /var/www/html/vendor/phpunit/phpunit/src/TextUI/TestRunner.php, line 651
PHPUnit\TextUI\Command::run() /var/www/html/vendor/phpunit/phpunit/src/TextUI/Command.php, line 144
PHPUnit\TextUI\Command::main() /var/www/html/vendor/phpunit/phpunit/src/TextUI/Command.php, line 97
include /var/www/html/vendor/phpunit/phpunit/phpunit, line 107
[main] /var/www/html/vendor/bin/phpunit, line 122
... 15 / 15 (100%)

Time: 00:11.032, Memory: 28.00 MB

OK, but incomplete, skipped, or risky tests!
Tests: 15, Assertions: 11, Incomplete: 10.

$site = $content->site->toArray();

のパターンでは$siteは配列になるため、配列の場合も考慮してuse_subdomainを取得する必要があるかと思いますが、如何でしょうか。

@ryuring
Copy link
Collaborator

ryuring commented Jan 14, 2024

@kouki-miura2 指定ありがとうございます。調整しました。
b8ec39f

@ryuring ryuring added the Todo 実行確定タスク label Jan 14, 2024
@ryuring ryuring self-assigned this Jan 14, 2024
@ryuring ryuring closed this as completed Mar 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Todo 実行確定タスク
Projects
None yet
Development

No branches or pull requests

2 participants