mirror of
https://github.com/ascribe/wp-theme
synced 2024-12-22 09:13:38 +01:00
Not working theme
This commit is contained in:
parent
025e035ca0
commit
9994b59a31
@ -122,7 +122,7 @@ module.exports = function( grunt ) {
|
||||
},
|
||||
cache: 'sftpCache.json',
|
||||
src: '/Users/sarahetter/Dropbox/_shared/sarahetter/ascribe/assets/css/',
|
||||
dest: '/home/ascribe/public_html/wp-content/themes/territorial/assets/css',
|
||||
dest: '/home/ascribe/public_html/wp-content/themes/ascribe/assets/css',
|
||||
serverSep: '/',
|
||||
concurrency: 4,
|
||||
progress: true
|
||||
@ -135,7 +135,7 @@ module.exports = function( grunt ) {
|
||||
},
|
||||
cache: 'sftpCache.json',
|
||||
src: '/Users/sarahetter/Dropbox/_shared/sarahetter/ascribe/assets/js/',
|
||||
dest: '/home/ascribe/public_html/wp-content/themes/territorial/assets/js',
|
||||
dest: '/home/ascribe/public_html/wp-content/themes/ascribe/assets/js',
|
||||
serverSep: '/',
|
||||
concurrency: 4,
|
||||
progress: true
|
||||
@ -147,7 +147,7 @@ module.exports = function( grunt ) {
|
||||
authKey: 'key1'
|
||||
},
|
||||
src: '/Users/sarahetter/Dropbox/_shared/sarahetter/ascribe/controller/',
|
||||
dest: '/home/ascribe/public_html/wp-content/themes/territorial/controller/',
|
||||
dest: '/home/ascribe/public_html/wp-content/themes/ascribe/controller/',
|
||||
serverSep: '/',
|
||||
concurrency: 4,
|
||||
progress: true
|
||||
|
@ -1,5 +1,5 @@
|
||||
/**
|
||||
* ascribe.io
|
||||
* ascribe
|
||||
* http://wordpress.org/themes
|
||||
*
|
||||
* Copyright (c) 2015 Territorial
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "ascribeio",
|
||||
"description": "ascribe.io theme by Territorial",
|
||||
"description": "ascribe theme by Territorial",
|
||||
"version": "0.0.1",
|
||||
"type": "wordpress-theme",
|
||||
"keywords": [],
|
||||
|
@ -2,7 +2,7 @@
|
||||
/**
|
||||
* The template for displaying the footer.
|
||||
*
|
||||
* @package ascribe.io
|
||||
* @package ascribe
|
||||
* @since 0.1.0
|
||||
*/
|
||||
?>
|
||||
|
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* ascribe.io functions and definitions
|
||||
* ascribe functions and definitions
|
||||
*
|
||||
* When using a child theme (see http://codex.wordpress.org/Theme_Development and
|
||||
* http://codex.wordpress.org/Child_Themes), you can override certain functions
|
||||
@ -9,7 +9,7 @@
|
||||
* functions.php file. The child theme's functions.php file is included before the parent
|
||||
* theme's file, so the child theme functions would be used.
|
||||
*
|
||||
* @package ascribe.io
|
||||
* @package ascribe
|
||||
* @since 0.1.0
|
||||
*/
|
||||
|
||||
@ -26,4 +26,4 @@ require_once TTL_INC . 'functions/core.php';
|
||||
// Include lib classes
|
||||
|
||||
// Run the setup functions
|
||||
TenUp\ascribe.io\Core\setup();
|
||||
TenUp\ascribe\Core\setup();
|
@ -2,7 +2,7 @@
|
||||
/**
|
||||
* The template for displaying the header.
|
||||
*
|
||||
* @package ascribe.io
|
||||
* @package ascribe
|
||||
* @since 0.1.0
|
||||
*/
|
||||
?>
|
||||
|
@ -1,5 +1,4 @@
|
||||
<?php
|
||||
namespace TenUp\ascribe.io\Core;
|
||||
|
||||
/**
|
||||
* Set up theme defaults and register supported WordPress features.
|
||||
|
@ -2,7 +2,7 @@
|
||||
/**
|
||||
* The main template file
|
||||
*
|
||||
* @package ascribe.io
|
||||
* @package ascribe
|
||||
* @since 0.1.0
|
||||
*/
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: ascribe.io\n"
|
||||
"Project-Id-Version: ascribe\n"
|
||||
"POT-Creation-Date: 2015-09-16T23:04:11.784Z\n"
|
||||
"PO-Revision-Date: 2015-09-16T23:04:11.785Z\n"
|
||||
"Last-Translator: 10up <info@10up.com>\n"
|
||||
|
@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "ascribeio",
|
||||
"title": "ascribe.io",
|
||||
"description": "ascribe.io theme by Territorial",
|
||||
"title": "ascribe",
|
||||
"description": "ascribe theme by Territorial",
|
||||
"version": "0.0.1",
|
||||
"homepage": "http://wordpress.org/themes",
|
||||
"repository": {
|
||||
@ -29,6 +29,7 @@
|
||||
"grunt-phpunit": "^0.3.6",
|
||||
"grunt-postcss": "^0.5.4",
|
||||
"grunt-sass": "^1.0.0",
|
||||
"grunt-sftp-deploy": "^0.2.4",
|
||||
"load-grunt-tasks": "^3.2.0",
|
||||
"qunitjs": "~1.18.0"
|
||||
},
|
||||
|
BIN
screenshot.png
BIN
screenshot.png
Binary file not shown.
Before Width: | Height: | Size: 53 KiB After Width: | Height: | Size: 960 KiB |
1
sftpCache.json
Normal file
1
sftpCache.json
Normal file
@ -0,0 +1 @@
|
||||
{"/Users/sarahetter/Dropbox/_shared/sarahetter/ascribe/assets/css//ascribeio.css":"2015-09-16T23:36:41.000Z","/Users/sarahetter/Dropbox/_shared/sarahetter/ascribe/assets/css//ascribeio.min.css":"2015-09-16T23:36:41.000Z","/Users/sarahetter/Dropbox/_shared/sarahetter/ascribe/assets/css//readme.md":"2015-09-16T23:04:11.000Z","/Users/sarahetter/Dropbox/_shared/sarahetter/ascribe/assets/css//less/ascribeio.less":"2015-09-16T23:17:47.000Z","/Users/sarahetter/Dropbox/_shared/sarahetter/ascribe/assets/js//ascribeio.js":"2015-09-16T23:36:44.000Z","/Users/sarahetter/Dropbox/_shared/sarahetter/ascribe/assets/js//ascribeio.min.js":"2015-09-16T23:36:44.000Z","/Users/sarahetter/Dropbox/_shared/sarahetter/ascribe/assets/js//src/ascribeio.js":"2015-09-16T23:04:11.000Z","/Users/sarahetter/Dropbox/_shared/sarahetter/ascribe/assets/js//vendor/readme.md":"2015-09-16T23:04:11.000Z"}
|
@ -1,7 +1,7 @@
|
||||
/**
|
||||
* Theme Name: ascribe.io
|
||||
* Theme Name: ascribe
|
||||
* Theme URI: http://wordpress.org/themes
|
||||
* Description: ascribe.io theme by Territorial
|
||||
* Description: ascribe theme by Territorial
|
||||
* Author: Territorial
|
||||
* Author URI: http://territorial.ca
|
||||
* Version: 0.1.0
|
||||
|
@ -1,163 +0,0 @@
|
||||
<?php
|
||||
namespace TenUp\ascribe.io\Core;
|
||||
|
||||
/**
|
||||
* This is a very basic test case to get things started. You should probably rename this and make
|
||||
* it work for your project. You can use all the tools provided by WP Mock and Mockery to create
|
||||
* your tests. Coverage is calculated against your includes/ folder, so try to keep all of your
|
||||
* functional code self contained in there.
|
||||
*
|
||||
* References:
|
||||
* - http://phpunit.de/manual/current/en/index.html
|
||||
* - https://github.com/padraic/mockery
|
||||
* - https://github.com/10up/wp_mock
|
||||
*/
|
||||
|
||||
use TenUp\ascribe.io as Base;
|
||||
|
||||
class Core_Tests extends Base\TestCase {
|
||||
|
||||
protected $testFiles = [
|
||||
'functions/core.php'
|
||||
];
|
||||
|
||||
/**
|
||||
* Make sure all theme-specific constants are defined before we get started
|
||||
*/
|
||||
public function setUp() {
|
||||
if ( ! defined( 'TTL_TEMPLATE_URL' ) ) {
|
||||
define( 'TTL_TEMPLATE_URL', 'template_url' );
|
||||
}
|
||||
if ( ! defined( 'TTL_VERSION' ) ) {
|
||||
define( 'TTL_VERSION', '0.0.1' );
|
||||
}
|
||||
if ( ! defined( 'TTL_URL' ) ) {
|
||||
define( 'TTL_URL', 'url' );
|
||||
}
|
||||
|
||||
parent::setUp();
|
||||
}
|
||||
|
||||
/**
|
||||
* Test setup method.
|
||||
*/
|
||||
public function test_setup() {
|
||||
// Setup
|
||||
\WP_Mock::expectActionAdded( 'after_setup_theme', 'TenUp\ascribe.io\Core\i18n' );
|
||||
\WP_Mock::expectActionAdded( 'wp_head', 'TenUp\ascribe.io\Core\header_meta' );
|
||||
\WP_Mock::expectActionAdded( 'wp_enqueue_scripts', 'TenUp\ascribe.io\Core\scripts' );
|
||||
\WP_Mock::expectActionAdded( 'wp_enqueue_scripts', 'TenUp\ascribe.io\Core\styles' );
|
||||
|
||||
// Act
|
||||
setup();
|
||||
|
||||
// Verify
|
||||
$this->assertConditionsMet();
|
||||
}
|
||||
|
||||
/**
|
||||
* Test internationalization integration.
|
||||
*/
|
||||
public function test_i18n() {
|
||||
// Setup
|
||||
\WP_Mock::wpFunction( 'load_theme_textdomain', array(
|
||||
'times' => 1,
|
||||
'args' => array(
|
||||
'ttl',
|
||||
TTL_PATH . '/languages'
|
||||
),
|
||||
) );
|
||||
|
||||
// Act
|
||||
i18n();
|
||||
|
||||
// Verify
|
||||
$this->assertConditionsMet();
|
||||
}
|
||||
|
||||
/**
|
||||
* Test scripts enqueue.
|
||||
*/
|
||||
public function test_scripts() {
|
||||
// Regular
|
||||
\WP_Mock::wpFunction( 'wp_enqueue_script', array(
|
||||
'times' => 1,
|
||||
'args' => array(
|
||||
'ttl',
|
||||
'template_url/assets/js/ascribeio.min.js',
|
||||
array(),
|
||||
'0.0.1',
|
||||
true,
|
||||
),
|
||||
) );
|
||||
|
||||
scripts();
|
||||
$this->assertConditionsMet();
|
||||
|
||||
// Debug Mode
|
||||
\WP_Mock::wpFunction( 'wp_enqueue_script', array(
|
||||
'times' => 1,
|
||||
'args' => array(
|
||||
'ttl',
|
||||
'template_url/assets/js/ascribeio.js',
|
||||
array(),
|
||||
'0.0.1',
|
||||
true,
|
||||
),
|
||||
) );
|
||||
|
||||
scripts( true );
|
||||
$this->assertConditionsMet();
|
||||
}
|
||||
|
||||
/**
|
||||
* Test style enqueue.
|
||||
*/
|
||||
public function test_styles() {
|
||||
// Regular
|
||||
\WP_Mock::wpFunction( 'wp_enqueue_style', array(
|
||||
'times' => 1,
|
||||
'args' => array(
|
||||
'ttl',
|
||||
'url/assets/css/ascribeio.min.css',
|
||||
array(),
|
||||
'0.0.1',
|
||||
),
|
||||
) );
|
||||
|
||||
styles();
|
||||
$this->assertConditionsMet();
|
||||
|
||||
// Debug Mode
|
||||
\WP_Mock::wpFunction( 'wp_enqueue_style', array(
|
||||
'times' => 1,
|
||||
'args' => array(
|
||||
'ttl',
|
||||
'url/assets/css/ascribeio.css',
|
||||
array(),
|
||||
'0.0.1',
|
||||
),
|
||||
) );
|
||||
|
||||
styles( true );
|
||||
$this->assertConditionsMet();
|
||||
}
|
||||
|
||||
/**
|
||||
* Test header meta injection
|
||||
*/
|
||||
public function test_header_meta() {
|
||||
// Setup
|
||||
$meta = '<link type="text/plain" rel="author" href="template_url/humans.txt" />';
|
||||
\WP_Mock::onFilter( 'ttl_humans' )->with( $meta )->reply( $meta );
|
||||
|
||||
// Act
|
||||
ob_start();
|
||||
header_meta();
|
||||
$result = ob_get_clean();
|
||||
|
||||
// Verify
|
||||
$this->assertConditionsMet();
|
||||
$this->assertEquals( $meta, $result );
|
||||
}
|
||||
}
|
@ -1,75 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace TenUp\ascribe.io;
|
||||
|
||||
use PHPUnit_Framework_TestResult;
|
||||
use Text_Template;
|
||||
use WP_Mock;
|
||||
use WP_Mock\Tools\TestCase as BaseTestCase;
|
||||
|
||||
class TestCase extends BaseTestCase {
|
||||
public function run( PHPUnit_Framework_TestResult $result = null ) {
|
||||
$this->setPreserveGlobalState( false );
|
||||
return parent::run( $result );
|
||||
}
|
||||
|
||||
protected $testFiles = array();
|
||||
|
||||
public function setUp() {
|
||||
if ( ! empty( $this->testFiles ) ) {
|
||||
foreach ( $this->testFiles as $file ) {
|
||||
if ( file_exists( PROJECT . $file ) ) {
|
||||
require_once( PROJECT . $file );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
parent::setUp();
|
||||
}
|
||||
|
||||
public function assertActionsCalled() {
|
||||
$actions_not_added = $expected_actions = 0;
|
||||
try {
|
||||
WP_Mock::assertActionsCalled();
|
||||
} catch ( \Exception $e ) {
|
||||
$actions_not_added = 1;
|
||||
$expected_actions = $e->getMessage();
|
||||
}
|
||||
$this->assertEmpty( $actions_not_added, $expected_actions );
|
||||
}
|
||||
|
||||
public function ns( $function ) {
|
||||
if ( ! is_string( $function ) || false !== strpos( $function, '\\' ) ) {
|
||||
return $function;
|
||||
}
|
||||
|
||||
$thisClassName = trim( get_class( $this ), '\\' );
|
||||
|
||||
if ( ! strpos( $thisClassName, '\\' ) ) {
|
||||
return $function;
|
||||
}
|
||||
|
||||
// $thisNamespace is constructed by exploding the current class name on
|
||||
// namespace separators, running array_slice on that array starting at 0
|
||||
// and ending one element from the end (chops the class name off) and
|
||||
// imploding that using namespace separators as the glue.
|
||||
$thisNamespace = implode( '\\', array_slice( explode( '\\', $thisClassName ), 0, - 1 ) );
|
||||
|
||||
return "$thisNamespace\\$function";
|
||||
}
|
||||
|
||||
/**
|
||||
* Define constants after requires/includes
|
||||
*
|
||||
* See http://kpayne.me/2012/07/02/phpunit-process-isolation-and-constant-already-defined/
|
||||
* for more details
|
||||
*
|
||||
* @param \Text_Template $template
|
||||
*/
|
||||
public function prepareTemplate( \Text_Template $template ) {
|
||||
$template->setVar( [
|
||||
'globals' => '$GLOBALS[\'__PHPUNIT_BOOTSTRAP\'] = \'' . $GLOBALS['__PHPUNIT_BOOTSTRAP'] . '\';',
|
||||
] );
|
||||
parent::prepareTemplate( $template );
|
||||
}
|
||||
}
|
@ -1,14 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>QUnit Example</title>
|
||||
<link rel="stylesheet" href="../../node_modules/qunitjs/qunit/qunit.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="qunit"></div>
|
||||
<div id="qunit-fixture"></div>
|
||||
<script src="../../node_modules/qunitjs/qunit/qunit.js"></script>
|
||||
<script src="tests/ascribeio.js"></script>
|
||||
</body>
|
||||
</html>
|
@ -1,4 +0,0 @@
|
||||
// Qunit Tests
|
||||
test( "hello test", function() {
|
||||
ok( 1 == "1", "Passed!" );
|
||||
});
|
Loading…
Reference in New Issue
Block a user