This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @author David Wickström <davidwickstrom@gmail.com> | |
*/ | |
trait AssertState | |
{ | |
/** | |
* Access any value off any object given a property with any visibility mode | |
* | |
* @param $field |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"require-dev": { | |
"phpunit/phpunit": "~4.5", | |
"MageTest/Manager": "~1.0" | |
}, | |
"repositories": [ | |
{ | |
"type": "vcs", | |
"url": "git@github.com:dwickstrom/Manager.git" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<phpunit backupGlobals="false" | |
backupStaticAttributes="false" | |
bootstrap="vendor/autoload.php" | |
colors="true" | |
convertErrorsToExceptions="true" | |
convertNoticesToExceptions="true" | |
convertWarningsToExceptions="true" | |
processIsolation="false" | |
stopOnFailure="false" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class MageEnvironmentTrait | |
{ | |
public function setEnvironment($env = null) | |
{ | |
if (!$env) { | |
$env = Mage_Core_Model_App_Area::AREA_FRONTEND; | |
} | |
Mage::getSingleton('core/session', array('name' => $env)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from os.path import join, dirname | |
from dotenv import load_dotenv | |
dotenv_path = join(dirname(__file__), '.env') | |
load_dotenv(dotenv_path) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import threading | |
from wsgiref import simple_server | |
from selenium import webdriver | |
from my_application import model | |
from my_application import web_app | |
def before_all(context): | |
context.server = simple_server.WSGIServer(('', 8000)) | |
context.server.set_app(web_app.main(environment='test')) | |
context.thread = threading.Thread(target=context.server.serve_forever) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use Mage; | |
trait HandleAttributes | |
{ | |
/** | |
* @param Mage_Catalog_Model_Product $simple | |
* @param Mage_Catalog_Model_Product $configurable | |
* @param array $attributeIds |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DB_USER=root | |
DB_HOST=localhost | |
DB_PASSWORD=topsecret | |
DB_NAME=foo_bar_test | |
FRONT_NAME=admin | |
SESSION_SAVE=db | |
MAGENTO_ROOT=vendor/magento/core | |
HOST_NAME=localhost:8787 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Get option value, unless we are in debug mode && that key is set in the environment | |
*/ | |
function get_environment_variable($varname) { | |
if (!is_string($varname)) throw new Exception('Strings only.'); | |
if (getenv('WP_DEBUG')) { | |
return (getenv(strtoupper($varname))) ? : get_option($varname); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.test.runner import DiscoverRunner | |
class NoDbTestRunner(DiscoverRunner): | |
""" A test runner to test without database creation """ | |
def setup_databases(self, **kwargs): | |
""" Override the database creation defined in parent class """ | |
pass |
OlderNewer