소스 검색

First commit of Squarepay Extension

Richard Knight 6 년 전
커밋
82bc48b908
9개의 변경된 파일176개의 추가작업 그리고 0개의 파일을 삭제
  1. 10 0
      README.md
  2. 38 0
      composer.json
  3. 0 0
      config/.gitignore
  4. 63 0
      phpunit.xml.dist
  5. 18 0
      src/RakTest1Extension.php
  6. 0 0
      templates/.gitignore
  7. 40 0
      tests/ExtensionTest.php
  8. 7 0
      tests/bootstrap.php
  9. 0 0
      web/.gitignore

+ 10 - 0
README.md

@@ -0,0 +1,10 @@
+Bolt Extension Starter: RAK TEST 1
+==================================
+
+A starter skeleton for a Bolt v3.x Extension
+
+To get going run the following command, replacing the last argument with the name of your extension:
+
+`composer create-project --no-install 'bolt/bolt-extension-starter:^3.0' <newextname>`  
+
+For more information, see this page in the Bolt documentation: https://docs.bolt.cm/extensions/building-starter/about

+ 38 - 0
composer.json

@@ -0,0 +1,38 @@
+{
+    "name": "apewave/raktest1",
+    "description": "A test of Bolt Extensions",
+    "type": "bolt-extension",
+    "keywords": [
+		"test"
+    ],
+    "require": {
+        "bolt/bolt": "^3.6"
+    },
+    "require-dev": {
+        "phpunit/phpunit": "^4.7"
+    },
+    "license": "MIT",
+    "authors": [
+        {
+            "name": "Richard Knight",
+            "email": "rich@apewavwe.com"
+        }
+    ],
+    "minimum-stability": "dev",
+    "prefer-stable": true,
+    "autoload": {
+        "psr-4": {
+            "Bolt\\Extension\\Apewave\\RakTest1\\": "src"
+        }
+    },
+    "autoload-dev": {
+        "psr-4": {
+            "Bolt\\Extension\\Apewave\\RakTest1\\Tests\\": "tests",
+            "Bolt\\Tests\\": "vendor/bolt/bolt/tests/phpunit/unit/"
+        }
+    },
+    "extra": {
+        "bolt-assets": "web",
+        "bolt-class": "Bolt\\Extension\\Apewave\\RakTest1\\RakTest1Extension"
+    }
+}

+ 0 - 0
config/.gitignore


+ 63 - 0
phpunit.xml.dist

@@ -0,0 +1,63 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<phpunit backupGlobals="false"
+         backupStaticAttributes="false"
+         bootstrap="tests/bootstrap.php"
+         colors="true"
+         convertErrorsToExceptions="true"
+         convertNoticesToExceptions="true"
+         convertWarningsToExceptions="true"
+         processIsolation="false"
+         stopOnFailure="false"
+         syntaxCheck="false">
+    <testsuites>
+        <testsuite name="unit">
+            <directory>tests</directory>
+        </testsuite>
+    </testsuites>
+    <listeners>
+        <listener file="vendor/bolt/bolt/tests/phpunit/BoltListener.php" class="Bolt\Tests\BoltListener">
+            <arguments>
+                <!-- Configuration files. Can be either .yml or .yml.dist files -->
+                <!-- Locations can be relative to TEST_ROOT directory, the Bolt directory, or an absolute path -->
+                <array>
+                    <element key="config">
+                        <string>vendor/bolt/bolt/app/config/config.yml.dist</string>
+                    </element>
+                    <element key="contenttypes">
+                        <string>vendor/bolt/bolt/app/config/contenttypes.yml.dist</string>
+                    </element>
+                    <element key="menu">
+                        <string>vendor/bolt/bolt/app/config/menu.yml.dist</string>
+                    </element>
+                    <element key="permissions">
+                        <string>vendor/bolt/bolt/app/config/permissions.yml.dist</string>
+                    </element>
+                    <element key="routing">
+                        <string>vendor/bolt/bolt/app/config/routing.yml.dist</string>
+                    </element>
+                    <element key="taxonomy">
+                        <string>vendor/bolt/bolt/app/config/taxonomy.yml.dist</string>
+                    </element>
+                </array>
+                <!-- Theme directory. Can be relative to TEST_ROOT directory, the Bolt directory, or an absolute path -->
+                <array>
+                    <element key="theme">
+                        <string>theme/base-2014</string>
+                    </element>
+                </array>
+                <!-- The Bolt SQLite database, leave empty to use the one bundled with Bolt's repository -->
+                <!-- Location can be relative to TEST_ROOT directory, the Bolt directory, or an absolute path -->
+                <array>
+                    <element key="boltdb">
+                        <string>vendor/bolt/bolt/tests/phpunit/unit/resources/db/bolt.db</string>
+                    </element>
+                </array>
+                <!-- Reset the cache and test temporary directories -->
+                <boolean>true</boolean>
+                <!-- Create timer output in app/cache/phpunit-test-timer.txt -->
+                <boolean>true</boolean>
+            </arguments>
+        </listener>
+    </listeners>
+</phpunit>
+

+ 18 - 0
src/RakTest1Extension.php

@@ -0,0 +1,18 @@
+<?php
+
+namespace Bolt\Extension\Apewave\RakTest1;
+
+use Bolt\Extension\SimpleExtension;
+
+/**
+ * RakTest1 extension class.
+ *
+ * @author Richard Knight <rich@apewave.com>
+ */
+class RakTest1Extension extends SimpleExtension
+{
+	
+
+
+
+}

+ 0 - 0
templates/.gitignore


+ 40 - 0
tests/ExtensionTest.php

@@ -0,0 +1,40 @@
+<?php
+
+namespace Bolt\Extension\YourName\ExtensionName\Tests;
+
+use Bolt\Tests\BoltUnitTest;
+use Bolt\Extension\YourName\ExtensionName\ExtensionNameExtension;
+
+/**
+ * ExtensionName testing class.
+ *
+ * @author Your Name <you@example.com>
+ */
+class ExtensionTest extends BoltUnitTest
+{
+    /**
+     * Ensure that the ExtensionName extension loads correctly.
+     */
+    public function testExtensionBasics()
+    {
+        $app = $this->getApp(false);
+        $extension = new ExtensionNameExtension($app);
+
+        $name = $extension->getName();
+        $this->assertSame($name, 'ExtensionName');
+        $this->assertInstanceOf('\Bolt\Extension\ExtensionInterface', $extension);
+    }
+
+    public function testExtensionComposerJson()
+    {
+        $composerJson = json_decode(file_get_contents(dirname(__DIR__) . '/composer.json'), true);
+
+        // Check that the 'bolt-class' key correctly matches an existing class
+        $this->assertArrayHasKey('bolt-class', $composerJson['extra']);
+        $this->assertTrue(class_exists($composerJson['extra']['bolt-class']));
+
+        // Check that the 'bolt-assets' key points to the correct directory
+        $this->assertArrayHasKey('bolt-assets', $composerJson['extra']);
+        $this->assertSame('web', $composerJson['extra']['bolt-assets']);
+    }
+}

+ 7 - 0
tests/bootstrap.php

@@ -0,0 +1,7 @@
+<?php
+
+include_once __DIR__ . '/../vendor/bolt/bolt/tests/phpunit/bootstrap.php';
+
+define('EXTENSION_AUTOLOAD',  realpath(dirname(__DIR__) . '/vendor/autoload.php'));
+
+require_once EXTENSION_AUTOLOAD;

+ 0 - 0
web/.gitignore