public function testCreate() { $bxObject = m::mock('object'); $bxObject->shouldReceive('add')->with(['NAME' => 'Section 1'])->once()->andReturn(3); TestSection::$bxObject = $bxObject; $newTestSection = TestSection::create(['NAME' => 'Section 1']); $this->assertSame(3, $newTestSection->id); $this->assertSame(['NAME' => 'Section 1', 'ID' => 3], $newTestSection->fields); }