Skip to content

Commit

Permalink
#101 Filename getter (#102)
Browse files Browse the repository at this point in the history
* Update Compiler.php
* Test for getFilename
* Fix variable name
* Fix dev dependencies compatibility
  • Loading branch information
kylekatarnls authored Jan 12, 2017
1 parent db01b01 commit f83a59d
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 1 deletion.
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -120,13 +120,14 @@
"role": "contributor"
}
],
"minimum-stability": "stable",
"require": {
"php": ">=5.3.0",
"js-phpize/js-phpize": "^1.2"
},
"require-dev": {
"phpunit/phpunit": ">=4.0",
"codeclimate/php-test-reporter": "dev-master"
"codeclimate/php-test-reporter": ">=0.3"
},
"autoload": {
"psr-0": {
Expand Down
10 changes: 10 additions & 0 deletions src/Jade/Compiler.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,16 @@ public function __construct($options = array(), array $filters = array(), $filen
$this->jsPhpize = $jsPhpize;
}

/**
* Get the filename passed to the compiler.
*
* @return Compiler
*/
public function getFilename()
{
return $this->filename;
}

/**
* Get a compiler with the same settings.
*
Expand Down
6 changes: 6 additions & 0 deletions tests/compiler/options.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,10 @@ public function testEngineOptions()
$this->assertSame('@', $compiler->getOption('indentChar'));
$this->assertSame('bar', $compiler->getOption('foo'));
}

public function testCompilerGetFilename()
{
$compiler = new Compiler(array(), array(), 'foobar');
$this->assertSame('foobar', $compiler->getFilename());
}
}

0 comments on commit f83a59d

Please sign in to comment.