Example #1
0
 public function setUp()
 {
     parent::setUp();
     $this->repo = $this->getMock(__NAMESPACE__ . '\\Repo', ['findAll', 'loadRelFor'], [__NAMESPACE__ . '\\Model']);
     $this->find = $this->getMock(__NAMESPACE__ . '\\Find', ['where', 'limit', 'execute'], [$this->repo]);
     $this->repo->expects($this->any())->method('findAll')->will($this->returnValue($this->find));
 }
 public function setUp()
 {
     parent::setUp();
     if (!is_dir(__DIR__ . '/../../repos')) {
         mkdir(__DIR__ . '/../../repos');
     }
     $this->env = new Env([new DirectoryParam(__DIR__ . '/../../repos', ['Address.json' => '{
                 "1": {
                     "id": 1,
                     "name": null,
                     "location": "test location"
                 }
             }', 'Post.json' => '{
                 "1": {
                     "id": 1,
                     "name": "post 1",
                     "body": "my post 1",
                     "userId": 1,
                     "class": "Harp\\\\Core\\\\Test\\\\Model\\\\Post"
                 },
                 "2": {
                     "id": 2,
                     "name": "post 2",
                     "body": "my post 2",
                     "userId": 1,
                     "url": "http:\\/\\/example.com\\/post2",
                     "class": "Harp\\\\Core\\\\Test\\\\Model\\\\BlogPost"
                 }
             }', 'User.json' => '{
                 "1": {
                     "id": 1,
                     "name": "name",
                     "password": null,
                     "addressId": 1,
                     "deletedAt": null,
                     "isBlocked": true,
                     "profile" : "{\\"firstName\\":\\"tester\\"}"
                 },
                 "2": {
                     "id": 2,
                     "name": "deleted",
                     "password": null,
                     "addressId": 1,
                     "deletedAt": 1401949982,
                     "isBlocked": false,
                     "profile" : null
                 }
             }'])]);
     $this->env->apply();
 }