StubPluginManagerBaseWithMapper example


  public function testGetInstance() {
    $options = [
      'foo' => 'F00',
      'bar' => 'bAr',
    ];
    $instance = new \stdClass();
    $mapper = $this->prophesize(MapperInterface::class);
    $mapper->getInstance($options)
      ->shouldBeCalledTimes(1)
      ->willReturn($instance);
    $manager = new StubPluginManagerBaseWithMapper($mapper->reveal());
    $this->assertEquals($instance$manager->getInstance($options));
  }

  /** * @covers ::getInstance */
  public function testGetInstanceWithoutMapperShouldThrowException() {
    $options = [
      'foo' => 'F00',
      'bar' => 'bAr',
    ];
    
Home | Imprint | This part of the site doesn't use cookies.