Skip to content

Commit

Permalink
Merge pull request #2622 from timber/2.x-update-tests-fix-indentation
Browse files Browse the repository at this point in the history
2.x update tests fix indentation
  • Loading branch information
gchtr committed Jul 29, 2022
2 parents 07838be + d6a5c17 commit 67c72fc
Show file tree
Hide file tree
Showing 44 changed files with 4,876 additions and 4,875 deletions.
3 changes: 3 additions & 0 deletions .git-blame-ignore-revs
Expand Up @@ -15,3 +15,6 @@ b2474ccd46f9374d52f00c8a195be2266463cf4f

# Coding Style: Updated Spaces
73123a96d3fc055f08da036b0121b469a75e3371

# Tests indentation
f0216ce423bb133ce668774a5f75ca86455b7280
14 changes: 7 additions & 7 deletions tests/assets/Sport.php
@@ -1,9 +1,9 @@
<?php

class Sport extends \Timber\Post
{
public function channel()
{
return 'ESPN';
}
}
class Sport extends \Timber\Post
{
public function channel()
{
return 'ESPN';
}
}
6 changes: 3 additions & 3 deletions tests/assets/my-sidebar.php
@@ -1,5 +1,5 @@
<?php

echo 'Panic! at the Disco';
echo ' from ';
echo 2015 - 10;
echo 'Panic! at the Disco';
echo ' from ';
echo 2015 - 10;
50 changes: 25 additions & 25 deletions tests/benchmark/benchmark-timber-loader.php
@@ -1,34 +1,34 @@
<?php

class TimberBenchmark
class TimberBenchmark
{
public static function testLoader()
{
public static function testLoader()
{
$TimberLoader = new Timber\Loader();
for ($i = 0; $i < 5000; $i++) {
$loader = $TimberLoader->get_loader();
}
$TimberLoader = new Timber\Loader();
for ($i = 0; $i < 5000; $i++) {
$loader = $TimberLoader->get_loader();
}
}

public static function testImageResize()
{
$img = 'arch.jpg';
public static function testImageResize()
{
$img = 'arch.jpg';
$upload_dir = wp_upload_dir();
$destination = $upload_dir['path'] . '/' . $img;
if (!file_exists($destination)) {
copy(__DIR__ . '/../assets/' . $img, $destination);
}
for ($i = 0; $i < 20; $i++) {
$upload_dir = wp_upload_dir();
$destination = $upload_dir['path'] . '/' . $img;
if (!file_exists($destination)) {
copy(__DIR__ . '/../assets/' . $img, $destination);
}
for ($i = 0; $i < 20; $i++) {
$upload_dir = wp_upload_dir();
$img = Timber\ImageHelper::resize($upload_dir['url'] . '/arch.jpg', 500, 200, 'default', true);
}
$img = Timber\ImageHelper::resize($upload_dir['url'] . '/arch.jpg', 500, 200, 'default', true);
}
}

public static function run($function)
{
$start_time = microtime(true);
self::$function();
$end_time = microtime(true);
echo $end_time - $start_time;
}
public static function run($function)
{
$start_time = microtime(true);
self::$function();
$end_time = microtime(true);
echo $end_time - $start_time;
}
}
28 changes: 14 additions & 14 deletions tests/benchmark/benchmark-timber.php
@@ -1,20 +1,20 @@
<?php

class TimberBenchmark
class TimberBenchmark
{
public static function testLoader()
{
public static function testLoader()
{
$TimberLoader = new Timber\Loader();
for ($i = 0; $i < 5000; $i++) {
$loader = $TimberLoader->get_loader();
}
$TimberLoader = new Timber\Loader();
for ($i = 0; $i < 5000; $i++) {
$loader = $TimberLoader->get_loader();
}
}

public static function run($function)
{
$start_time = microtime(true);
self::$function();
$end_time = microtime(true);
echo $end_time - $start_time;
}
public static function run($function)
{
$start_time = microtime(true);
self::$function();
$end_time = microtime(true);
echo $end_time - $start_time;
}
}
10 changes: 5 additions & 5 deletions tests/php/timber-custom-comment.php
@@ -1,9 +1,9 @@
<?php

class CustomComment extends \Timber\Comment
class CustomComment extends \Timber\Comment
{
public function foo()
{
public function foo()
{
return 'bar';
}
return 'bar';
}
}
10 changes: 5 additions & 5 deletions tests/php/timber-post-subclass.php
@@ -1,9 +1,9 @@
<?php

class TimberPostSubclass extends Timber\Post
class TimberPostSubclass extends Timber\Post
{
public function foo()
{
public function foo()
{
return 'bar';
}
return 'bar';
}
}
10 changes: 5 additions & 5 deletions tests/php/timber-term-subclass.php
@@ -1,9 +1,9 @@
<?php

class TimberTermSubclass extends Timber\Term
class TimberTermSubclass extends Timber\Term
{
public function foo()
{
public function foo()
{
return 'bar';
}
return 'bar';
}
}

0 comments on commit 67c72fc

Please sign in to comment.