Permalink
Browse files

Removed configuring converters in Environment constructor

  • Loading branch information...
1 parent 3f89244 commit d218d6244612666a16fa0865cdaaacf8bdea2a8f @filipgolonka filipgolonka committed Dec 28, 2016
Showing with 2 additions and 29 deletions.
  1. +2 −3 README.md
  2. +0 −7 src/Environment.php
  3. +0 −19 tests/EnvironmentTest.php
View
@@ -129,10 +129,9 @@ You can pass current `Environment` object to customize i.e. which converters sho
```php
$environment = new Environment(array(
- 'converters' => array(
- new HeaderConverter(),
- ),
+ // your configuration here
));
+$environment->addConverter(new HeaderConverter()); // optionally - add converter manually
$converter = new HtmlConverter($environment);
View
@@ -35,13 +35,6 @@
public function __construct(array $config = array())
{
$this->config = new Configuration($config);
-
- if (isset($config['converters'])) {
- foreach ($config['converters'] as $converter) {
- $this->addConverter($converter);
- }
- }
-
$this->addConverter(new DefaultConverter());
}
@@ -2,29 +2,10 @@
namespace League\HTMLToMarkdown\Test;
-use League\HTMLToMarkdown\Converter\HeaderConverter;
use League\HTMLToMarkdown\Environment;
class EnvironmentTest extends \PHPUnit_Framework_TestCase
{
- public function test_creation_with_converters()
- {
- $environment = new Environment(array(
- 'converters' => array(
- new HeaderConverter(),
- ),
- ));
-
- $this->assertInstanceOf(
- 'League\HTMLToMarkdown\Converter\HeaderConverter',
- $environment->getConverterByTag('h3')
- );
- $this->assertInstanceOf(
- 'League\HTMLToMarkdown\Converter\DefaultConverter',
- $environment->getConverterByTag('img')
- );
- }
-
public function test_creation()
{
$environment = Environment::createDefaultEnvironment();

0 comments on commit d218d62

Please sign in to comment.