Skip to content
This repository has been archived by the owner on Nov 2, 2018. It is now read-only.

Commit

Permalink
Changed Zepto\ZeptoTwigExtension to Zepto\Extension\Twig, upd…
Browse files Browse the repository at this point in the history
…ated ``Zepto\Zepto`` accordingly
  • Loading branch information
hassankhan committed Feb 12, 2014
1 parent c8bb483 commit 3b605e0
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 15 deletions.
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
<?php

namespace Zepto;
namespace Zepto\Extension;

/**
* TwigExtension
*
* Twig
*
* @package Zepto
* @subpackage ZeptoTwigExtension
* @subpackage Extension
* @author Hassan Khan <contact@hassankhan.me>
* @link http://https://github.com/hassankhan/Zepto
* @license MIT
* @since 0.6
*/
class ZeptoTwigExtension extends \Twig_Extension
class Twig extends \Twig_Extension
{
/**
* I don't even know why this is here, but it is, so deal with it
Expand All @@ -22,7 +21,7 @@ class ZeptoTwigExtension extends \Twig_Extension
*/
public function getName()
{
return 'ZeptoTwigExtension';
return 'Twig';
}

/**
Expand All @@ -42,26 +41,26 @@ public function getFunctions()
/**
* Returns a fully-qualified URL for a given filename in the 'content' directory
*
* @see Zepto\Helper::url_for()
* @see \Zepto\Helper::url_for()
* @param string $file_name
* @return string|null
*/
public function url_for($file_name)
{
$zepto = Zepto::instance();
$zepto = \Zepto\Zepto::instance();
return $zepto->app['helper']->url_for($file_name);
}

/**
* Returns a HTML <a> for a given filename in the 'content' directory
*
* @see Zepto\Helper::link_for()
* @see \Zepto\Helper::link_for()
* @param string $file_name
* @return string|null
*/
public function link_for($file_name)
{
$zepto = Zepto::instance();
$zepto = \Zepto\Zepto::instance();
return $zepto->app['helper']->link_for($file_name);
}

Expand Down
2 changes: 1 addition & 1 deletion library/Zepto/Zepto.php
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ function($app) {
$twig = new \Twig_Environment(
new \Twig_Loader_Filesystem($app['ROOT_DIR'] . 'templates')
);
$twig->addExtension(new ZeptoTwigExtension);
$twig->addExtension(new Extension\Twig);
return $twig;
}
);
Expand Down
6 changes: 2 additions & 4 deletions tests/Zepto/ZeptoTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ public function testLoadPlugins()
}

/**
* @covers Zepto\Zepto::load_plugins()
* @covers Zepto\Zepto::load_plugins()
* @dataProvider providerConfig
*/
public function testLoadPluginsWhenDisabled($config)
Expand Down Expand Up @@ -227,7 +227,7 @@ public function testRunHooks()
}

/**
* @covers Zepto\Zepto::run_hooks
* @covers Zepto\Zepto::run_hooks
* @dataProvider providerConfig
*/
public function testRunHooksReturnsFalseWhenPluginsAreDisabled($config)
Expand All @@ -246,7 +246,6 @@ public function testRunHooksReturnsFalseWhenPluginsAreDisabled($config)
public function testInstanceBeforeInitialization()
{
$this->assertNull(Zepto::instance());
// $this->markTestIncomplete('Not yet implemented');
}

/**
Expand All @@ -257,7 +256,6 @@ public function testInstanceAfterInitialization()
{
$zepto = new Zepto();
$this->assertInstanceOf('Zepto\Zepto', Zepto::instance());
// $this->markTestIncomplete('Not yet implemented');
}

public function providerConfig()
Expand Down

0 comments on commit 3b605e0

Please sign in to comment.