executeStatements([ <<<'SQL' CREATE TABLE plugin_wuma_sales_user ( id INTEGER PRIMARY KEY AUTOINCREMENT, phone TEXT DEFAULT '', password TEXT DEFAULT '', date_start TEXT DEFAULT NULL, date_after TEXT DEFAULT NULL, delete_time TEXT DEFAULT NULL ) SQL, ]); $this->executeStatements([ <<<'SQL' INSERT INTO plugin_wuma_sales_user (id, phone, password) VALUES (1, '13800138000', 'legacy-pass') SQL, ]); $request = $this->app->request ->withGet([]) ->withPost([ 'id' => 1, 'phone' => '13800138000', 'password' => password_mask(), 'date' => '2026-03-28 - 2027-03-28', ]) ->setMethod('POST') ->setController('sales.user') ->setAction('edit'); RequestContext::clear(); $this->app->instance('request', $request); $controller = new SalesUserController($this->app); $method = new \ReflectionMethod($controller, '_form_filter'); $method->setAccessible(true); $data = [ 'id' => 1, 'phone' => '13800138000', 'password' => password_mask(), 'date' => '2026-03-28 - 2027-03-28', ]; $method->invokeArgs($controller, [&$data]); $this->assertArrayNotHasKey('password', $data); $this->assertSame('2026-03-28', $data['date_start'] ?? ''); $this->assertSame('2027-03-28', $data['date_after'] ?? ''); } protected function defineSchema(): void { } }