示例#1
0
 /**
  * Assert that the json attributes do not show up when configured to do so
  */
 public function testEnableHiddenJsonAttributes()
 {
     // Mock the model with data
     $mock = new MockJsonDialectModel();
     $mock->setJsonColumns(['testColumn']);
     $mock->setAttribute('testColumn', json_encode(['foo' => 'bar']));
     $mock->showJsonAttributes(false);
     // Execute the insepect call
     $mock->inspectJsonColumns();
     // Assert that attribute isn't there
     $this->assertArrayNotHasKey('foo', $mock->toArray());
 }