wp-cli core install unknown: fatal: file /etc/postfix/main.cf: parameter mail_owner: user postfix has same user ID as _postfix

Postfix is a free and open-source mail transfer agent that routes and delivers electronic mail, when you get an error like this: unknown: “fatal: file /etc/postfix/main.cf: parameter mail_owner: user postfix has same user ID as _postfix it typically means you need to fix some configuration inside of /etc/postfix/main.cf. If you do not plan on ever … Read more

Give WP-Cli User Home Directory Privileges

Yes, I will accept the “newbie” embarrassment and answer my basic questions . 😉 1.) www-data 2.) For fellow wp-cli newbies, follow this excellent tutorial to get wp-cli working in local dev, and remember NOT to forget the last step. 🙂 3.) One should never put the html directory in /home/ for the reason malicious … Read more

Mocking WP_CLI static methods in unit tests

So I am using PEST as my testing framework, and if I just define my mocks in the helpers, they won’t be called correctly, because the WPCLI will probably be autoloaded after that on each test. So I added beforeEach(function () { $wpCliMock = \Mockery::mock(‘alias:WP_CLI’); $wpCliMock ->shouldReceive(‘success’) ->andReturnArg(0); $wpCliMock ->shouldReceive(‘error’) ->andReturnArg(0); }); Inside my tests, … Read more

Logs for WP CLI

When you are ready to start recording a log file, type: script screen.log Now, until you stop the script, all input and output in the Terminal will be stored in screen.log. When you are done, just type: exit Source: Ubuntu Guide – How To Log Terminal Commands

Working with CLI and missing my namespace classes inside

I found the issue, and I discover I missing a “vendor” folder in my root of the plugin and inside composer.json i missing a auto-loader of classes. So what there fix my issue is update my composer.json file and then run a composer install command after inside my plugin folder. { … “require”: { “php”: … Read more