Avatar 💻

recca0120 Tech Notes

Software Developer / Tech Notes

  1. Home
  2. Archives
  3. Categories
  4. Tags
  5. Search
  6. About
    1. Dark Mode

Archives

2026 49
2024 3
2023 11
2022 13
2020 15
More

Categories

PHP Laravel Testing Frontend DevOps Database Tools Python AI MacOS

Tags

Laravel Php Testing Javascript PHPUnit Sqlite Python Typescript Ai-Agent Claude-Code Composer Linux Aws Blade Developer-Tools Devops Docker Guzzle MCP Mockery
Featured image of post PHPUnit: Test Closures with Mockery::spy
Testing PHP

PHPUnit: Test Closures with Mockery::spy

Assertions inside a closure pass silently even if never called. Wrap the closure in Mockery::spy to verify invocation count and arguments in PHPUnit tests.

2022 年 11 月 26 日
正體中文
PHPUnit Mockery Php Testing
Featured image of post Mock IteratorAggregate with Mockery to Fix foreach in Tests
Testing PHP

Mock IteratorAggregate with Mockery to Fix foreach in Tests

Mocking IteratorAggregate breaks foreach in PHPUnit. Return an ArrayObject from the mocked getIterator method to make foreach iterate over test data correctly.

2022 年 11 月 25 日
正體中文
Mockery PHPUnit Php Testing
Featured image of post Why Laravel min/max Fails on Numbers: Add the numeric Rule
Laravel PHP

Why Laravel min/max Fails on Numbers: Add the numeric Rule

Laravel min/max rules compare string length by default, letting 0 pass validation. Add the numeric rule to switch to value comparison and fix the bug.

2022 年 11 月 23 日
正體中文
Laravel Validation Php
Featured image of post Write Deterministic PHPUnit Assertions with Mockery::capture
Testing PHP

Write Deterministic PHPUnit Assertions with Mockery::capture

When a method uses random_int internally, Mockery::capture with passthru captures the intermediate value so you can compute the expected result and assert it.

2022 年 11 月 22 日
正體中文
Php Mockery PHPUnit Testing
Featured image of post Get a Free VMware Fusion Player Personal License
MacOS

Get a Free VMware Fusion Player Personal License

VMware Fusion Player is free for personal use. Create a VMware account to get a License Key and download link, with tips for bypassing form validation issues.

2022 年 11 月 21 日
正體中文
VMware
Featured image of post Fix the Missing mysql Command After Installing DBngin
Database MacOS

Fix the Missing mysql Command After Installing DBngin

DBngin supports multiple MySQL versions but never adds them to PATH. Add one line to .bashrc pointing to the latest version to get the mysql command working.

2022 年 11 月 8 日
正體中文
MySQL MacOS
Featured image of post Laravel LazyCollection Loses Lazy Evaluation with Generator
Laravel PHP

Laravel LazyCollection Loses Lazy Evaluation with Generator

Passing a Generator directly to LazyCollection causes iterator_to_array to expand it all at once. Wrap it in a Closure to restore true lazy evaluation.

2020 年 8 月 17 日
正體中文
Laravel Php
Featured image of post GuzzleHttp getContents() Returns Empty on the Second Call
PHP

GuzzleHttp getContents() Returns Empty on the Second Call

Casting a GuzzleHttp Response to string auto-seeks to 0, but getContents() never resets the pointer, so the second call returns empty. Always rewind manually.

2020 年 8 月 5 日
正體中文
Guzzle PSR-7 Php
Featured image of post Connect Bluetooth on a Headless Raspberry Pi via CLI
DevOps

Connect Bluetooth on a Headless Raspberry Pi via CLI

Use bluetoothctl scan, pair, trust, and connect to pair Bluetooth devices on a headless Raspberry Pi without a desktop and auto-reconnect on every reboot.

2020 年 7 月 21 日
正體中文
Raspberry Pi Bluetooth Linux
Featured image of post Fix Redis Connection Refused After Upgrading to 6.0
Database DevOps

Fix Redis Connection Refused After Upgrading to 6.0

Redis 6.0 changed the defaults for bind and protected-mode, causing Connection refused errors. Adjust two settings in redis.conf to restore connectivity.

2020 年 7 月 21 日
正體中文
Redis
1 4 5 6 7 8 9 10
© 2020 - 2026 recca0120 Tech Notes
recca0120 on GitHub
Built with Hugo
Theme Stack designed by Jimmy