Feature: Add Tests for Search and SyncNotion Actions#179
Conversation
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
There was a problem hiding this comment.
Code Review
This pull request groups search query conditions within closures in SearchAction to ensure correct logical operator precedence, and introduces comprehensive feature tests for both SearchAction and SyncAction. Feedback suggests skipping empty strings during keyword parsing to prevent redundant LIKE '%%' queries, and avoiding the use of reflection on external library classes in tests to reduce fragility.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
| if (str_starts_with($word, '-')) { | ||
| $word = trim(substr($word, 1)); | ||
| if ($word !== '' && $word !== '0') { |
There was a problem hiding this comment.
キーワードに複数の連続したスペースが含まれている場合、explode(' ', $keyword) によって空文字列 "" が生成されます。このとき、str_starts_with($word, '-') は false となり、else ブロックが実行されて LIKE '%%' という不要なクエリが追加されてしまいます。
これを防ぐために、ループの先頭で空文字列をスキップすることをお勧めします。
また、日本語環境では全角スペース( )が区切り文字として使われることが多いため、将来的に全角スペースへの対応(preg_split への変更など)も検討するとより良くなります。
if ($word === '') {
continue;
}
if (str_starts_with($word, '-')) {
$word = trim(substr($word, 1));
if ($word !== '' && $word !== '0') {| $propertyCollection = (new \ReflectionClass(PropertyCollection::class))->newInstanceWithoutConstructor(); | ||
| $this->setReadonlyProperty($propertyCollection, 'properties', ['パックセット' => $multiSelect]); |
There was a problem hiding this comment.
|
AIレビューの指摘内容が妥当であったため、以下の通り修正を行いました。
|
1 similar comment
|
AIレビューの指摘内容が妥当であったため、以下の通り修正を行いました。
|
46e8907 to
395691a
Compare
SearchActionおよびSyncNotion Actionに対するテストを追加しました。また、SearchActionにおける除外検索の論理バグを修正しました。