{"action":"closed","issue":{"url":"https://api.github.com/repos/yiisoft/yii2/issues/11368","repository_url":"https://api.github.com/repos/yiisoft/yii2","labels_url":"https://api.github.com/repos/yiisoft/yii2/issues/11368/labels{/name}","comments_url":"https://api.github.com/repos/yiisoft/yii2/issues/11368/comments","events_url":"https://api.github.com/repos/yiisoft/yii2/issues/11368/events","html_url":"https://github.com/yiisoft/yii2/issues/11368","id":148865465,"number":11368,"title":"Model validate some attribute error","user":{"login":"dcb9","id":3984347,"avatar_url":"https://avatars.githubusercontent.com/u/3984347?v=3","gravatar_id":"","url":"https://api.github.com/users/dcb9","html_url":"https://github.com/dcb9","followers_url":"https://api.github.com/users/dcb9/followers","following_url":"https://api.github.com/users/dcb9/following{/other_user}","gists_url":"https://api.github.com/users/dcb9/gists{/gist_id}","starred_url":"https://api.github.com/users/dcb9/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dcb9/subscriptions","organizations_url":"https://api.github.com/users/dcb9/orgs","repos_url":"https://api.github.com/users/dcb9/repos","events_url":"https://api.github.com/users/dcb9/events{/privacy}","received_events_url":"https://api.github.com/users/dcb9/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/yiisoft/yii2/labels/status:ready%20for%20adoption","name":"status:ready for adoption","color":"02e10c"},{"url":"https://api.github.com/repos/yiisoft/yii2/labels/type:enhancement","name":"type:enhancement","color":"d7e102"}],"state":"closed","locked":false,"assignee":{"login":"SilverFire","id":4499203,"avatar_url":"https://avatars.githubusercontent.com/u/4499203?v=3","gravatar_id":"","url":"https://api.github.com/users/SilverFire","html_url":"https://github.com/SilverFire","followers_url":"https://api.github.com/users/SilverFire/followers","following_url":"https://api.github.com/users/SilverFire/following{/other_user}","gists_url":"https://api.github.com/users/SilverFire/gists{/gist_id}","starred_url":"https://api.github.com/users/SilverFire/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SilverFire/subscriptions","organizations_url":"https://api.github.com/users/SilverFire/orgs","repos_url":"https://api.github.com/users/SilverFire/repos","events_url":"https://api.github.com/users/SilverFire/events{/privacy}","received_events_url":"https://api.github.com/users/SilverFire/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/yiisoft/yii2/milestones/17","html_url":"https://github.com/yiisoft/yii2/milestones/2.0.9","labels_url":"https://api.github.com/repos/yiisoft/yii2/milestones/17/labels","id":1580065,"number":17,"title":"2.0.9","description":"","creator":{"login":"cebe","id":189796,"avatar_url":"https://avatars.githubusercontent.com/u/189796?v=3","gravatar_id":"","url":"https://api.github.com/users/cebe","html_url":"https://github.com/cebe","followers_url":"https://api.github.com/users/cebe/followers","following_url":"https://api.github.com/users/cebe/following{/other_user}","gists_url":"https://api.github.com/users/cebe/gists{/gist_id}","starred_url":"https://api.github.com/users/cebe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cebe/subscriptions","organizations_url":"https://api.github.com/users/cebe/orgs","repos_url":"https://api.github.com/users/cebe/repos","events_url":"https://api.github.com/users/cebe/events{/privacy}","received_events_url":"https://api.github.com/users/cebe/received_events","type":"User","site_admin":false},"open_issues":73,"closed_issues":2,"state":"open","created_at":"2016-02-12T16:35:34Z","updated_at":"2016-04-18T10:17:04Z","due_on":"2016-06-25T21:00:00Z","closed_at":null},"comments":17,"created_at":"2016-04-16T15:58:30Z","updated_at":"2016-04-18T10:17:04Z","closed_at":"2016-04-18T10:17:04Z","body":"### What steps will reproduce the problem?\r\n\r\nI have two scripts:\r\n\r\n```php\r\n<?php\r\n\r\nnamespace idarex\\pingppyii2;\r\n\r\nclass OrderForm extends \\yii\\base\\Model\r\n{\r\n    public $order_no;\r\n    public $subject;\r\n\r\n    public function rules()\r\n    {\r\n        return [\r\n            [['order_no', 'subject'], 'required'],\r\n        ];\r\n    }\r\n}\r\n```\r\n\r\n```php\r\n<?php\r\n\r\nclass OrderFormTest extends PHPUnit_Framework_TestCase\r\n{\r\n    public function testValidate()\r\n    {\r\n        $form = new \\idarex\\pingppyii2\\OrderForm();\r\n        $form->order_no = '1234';\r\n        $this->assertTrue($form->validate('order_no'), 'order_no is not empty');\r\n    }\r\n}\r\n```\r\n\r\nAnd runs `phpunit tests/OrderFormTest.php`\r\n\r\n### What is the expected result?\r\n\r\n```\r\nPHPUnit 4.8.24 by Sebastian Bergmann and contributors.\r\n\r\n.\r\n\r\nTime: 58 ms, Memory: 6.25Mb\r\n\r\nOK (1 test, 1 assertion)\r\n```\r\n\r\n### What do you get instead?\r\n\r\n```\r\nPHPUnit 4.8.24 by Sebastian Bergmann and contributors.\r\n\r\nF\r\n\r\nTime: 62 ms, Memory: 6.25Mb\r\n\r\nThere was 1 failure:\r\n\r\n1) OrderFormTest::testValidate\r\norder_no is not empty\r\nFailed asserting that false is true.\r\n\r\n/Users/bob/Documents/idarex/pingpp-yii2/tests/OrderFormTest.php:11\r\n/Users/bob/.composer/vendor/phpunit/phpunit/src/TextUI/Command.php:149\r\n/Users/bob/.composer/vendor/phpunit/phpunit/src/TextUI/Command.php:100\r\n\r\nFAILURES!\r\n```\r\n\r\n### Additional info\r\n\r\n| Q                | A\r\n| ---------------- | ---\r\n| Yii version      | 2.0.7\r\n| PHP version      | PHP 5.5.30 (cli)\r\n| Operating system | OS X 10.11.3 (15D21)\r\n"}}