public function testBuildersGetCalled() { $workspace = $this->prophet->prophesize('\\Apple_Exporter\\Workspace'); // Cleans up workspace $workspace->clean_up()->shouldBeCalled(); // Writes JSON $workspace->write_json(Argument::that(array($this, 'isValidJSON')))->shouldBeCalled(); // Get JSON $workspace->get_json()->shouldBeCalled(); $builder1 = $this->prophet->prophesize('\\Apple_Exporter\\Builders\\Builder'); $builder1->to_array()->shouldBeCalled(); $builder2 = $this->prophet->prophesize('\\Apple_Exporter\\Builders\\Builder'); $builder2->to_array()->shouldBeCalled(); $content = new Apple_Exporter\Exporter_Content(3, 'Title', '<p>Example content</p>'); $exporter = new Exporter($content, $workspace->reveal()); $exporter->initialize_builders(array('componentTextStyles' => $builder1->reveal(), 'componentLayouts' => $builder2->reveal())); $exporter->export(); }