old_contents:
component extends="wheels.Test" {

	/*
	 * Executes once before the test suite runs.
	 * Populates the test database on reload or if there are no tables in the database.
	 */
	function beforeAll() {
		local.tables = $dbinfo(datasource=application.wheels.dataSourceName, type="tables");
		if ((StructKeyExists(url, "reload") && url.reload == true) || !local.tables.recordCount) {
			include "populate.cfm";
		}
	}

	/*
	 * Executes before every test case if called from the package via super.superSetup().
	 */
	function setup() {

	}

	/*
	 * Executes after every test case if called from the package via super.superTeardown().
	 */
	function teardown() {

	}

	/*
	 * Executes once after the test suite runs.
	 */
	function afterAll() {

	}

}

new_contents:
component extends="wheels.Test" {

	/*
	 * Executes once before the test suite runs.
	 * Populates the test database on reload or if the authors table does not exist.
	 */
	function beforeAll() {
		local.tables = $dbinfo(datasource=application.wheels.dataSourceName, type="tables");
		local.tableList = ValueList(local.tables.table_name);
		if ((StructKeyExists(url, "reload") && url.reload == true) || !FindNoCase("authors", local.tableList)) {
			include "populate.cfm";
		}
	}

	/*
	 * Executes before every test case if called from the package via super.superSetup().
	 */
	function setup() {

	}

	/*
	 * Executes after every test case if called from the package via super.superTeardown().
	 */
	function teardown() {

	}

	/*
	 * Executes once after the test suite runs.
	 */
	function afterAll() {

	}

}

subject: Check for authors table instead of just any table to check whether to populate the test database.


old_contents:
component extends="wheels.Test" {

	/*
	 * Executes once before the test suite runs.
	 * Populates the test database on reload or if the authors table does not exist.
	 */
	function beforeAll() {
		local.tables = $dbinfo(datasource = application.wheels.dataSourceName, type = "tables");
		local.tableList = ValueList(local.tables.table_name);
		local.populate = StructKeyExists(url, "populate") ? url.populate : true;
		if (local.populate || !FindNoCase("authors", local.tableList)) {
			include "populate.cfm";
		}
	}

	/*
	 * Executes before every test case if called from the package via super.superSetup().
	 */
	function setup() {
	}

	/*
	 * Executes after every test case if called from the package via super.superTeardown().
	 */
	function teardown() {
	}

	/*
	 * Executes once after the test suite runs.
	 */
	function afterAll() {
	}

}

new_contents:
component extends="wheels.Test" {

	/*
	 * Executes once before the test suite runs.
	 * Populates the test database on reload or if the authors table does not exist.
	 */
	function beforeAll() {
		application.$$$wheels = duplicate(application.wheels);
		local.tables = $dbinfo(datasource = application.wheels.dataSourceName, type = "tables");
		local.tableList = ValueList(local.tables.table_name);
		local.populate = StructKeyExists(url, "populate") ? url.populate : true;
		if (local.populate || !FindNoCase("authors", local.tableList)) {
			include "populate.cfm";
		}
	}

	/*
	 * Executes before every test case if called from the package via super.superSetup().
	 */
	function setup() {
	}

	/*
	 * Executes after every test case if called from the package via super.superTeardown().
	 */
	function teardown() {
	}

	/*
	 * Executes once after the test suite runs.
	 */
	function afterAll() {
		application.wheels = application.$$$wheels;
		structDelete(application, "$$$wheels");
	}

}

subject: Reset application scope after core tests


old_contents:
component extends="testbox.system.BaseSpec" {
	function run(testResults, testBox) {
		dataDir = ExpandPath("../data/en");
		files = directoryList(dataDir, false, "array");
		filesWithErrors = [];

		describe("JSON Format Tests", function() {
			it("should be valid isJSON==true", function() {
				for (filePath in files) {
					var json = fileRead(filePath);
					var isItJson = isJSON(json);
					if (!isItJSON) {
						filesWithErrors.append(getFileFromPath(filePath));
					}
					expect(isItJSON).toBeTrue();

				}

			});

			it("should have key: name, type", function() {
				for (filePath in files) {
					var json = fileRead(filePath);
					var isItJson = isJSON(json);
					var fileName = getFileFromPath(filePath);
					if (isItJSON && fileName != "index.json") {
						json = deserializeJSON(json);
						if (!json.keyExists("name") || !json.keyExists("type")) {
							filesWithErrors.append(fileName);
							debug(json, "Missing key name or type in #fileName#");
						}
						expect(json).toHaveKey("name");
						expect(json).toHaveKey("type");
					}

				}
				debug(arguments,"inside it args");
			});

		});

		describe("There should be no errors", function(){
			it("filesWithErrors should be empty", function() {
				expect(filesWithErrors).toBe([]);
			});
		});

	}
}

new_contents:
component extends="testbox.system.BaseSpec" {
	function run(testResults, testBox) {
		dataDir = ExpandPath("../data/en");
		files = directoryList(dataDir, false, "array");

		describe("JSON Format Tests", function() {
			it("should be valid isJSON==true", function() {
				for (filePath in files) {
					var json = fileRead(filePath);
					var isItJson = isJSON(json);
					var fileName = getFileFromPath(filePath);
					expect(isItJSON).toBeTrue("#fileName# was NOT valid JSON");

				}

			});

			it("should have key: name, type", function() {
				for (filePath in files) {
					var json = fileRead(filePath);
					var isItJson = isJSON(json);
					var fileName = getFileFromPath(filePath);
					if (isItJSON && fileName != "index.json") {
						json = deserializeJSON(json);
						expect(json).toHaveKey("name", "#fileName# did not have key: name");
						expect(json).toHaveKey("type", "#fileName# did not have key: name");
					}

				}
			});

		});

	}
}

subject: Add custom messages to test expects

message: Add custom messages to test expects

license: mit


old_contents:
<cfcomponent output="false">
	<cfscript>
		this.name = "cfstatictests_" & hash(GetCurrenttemplatepath());

		root = GetDirectoryFromPath(GetCurrentTemplatePath());

		this.mappings['/mxunit']        = '#root#../mxunit';
		this.mappings['/org/cfstatic']  = '#root#../org/cfstatic';
		this.mappings['/tests']         = root;
	</cfscript>
</cfcomponent>

new_contents:
<cfcomponent output="false">
	<cfscript>
		this.name = "cfstatictests_" & hash(GetCurrenttemplatepath());

		root = GetDirectoryFromPath(GetCurrentTemplatePath());

		this.mappings['/mxunit']        = '#root#../mxunit';
		this.mappings['/org/cfstatic']  = '#root#../org/cfstatic';
		this.mappings['/tests']         = Left(root, Len(root)-1); // remove trailing slash - breaks openBDs ExpandPath() method...
	</cfscript>
</cfcomponent>

subject: Fix for OpenBD ExpandPath() issue with trailing slashes in mappings


old_contents:
component {

	this.title = "SendGrid Web API v3";
	this.author = "Matthew J. Clemente";
	this.webURL = "https://github.com/mjclemente/sendgrid.cfc";
	this.description = "A wrapper for the SendGrid Web API v3";

	function configure(){
		settings = {
			apiKey = '', // Required
			baseUrl = 'https://api.sendgrid.com/v3', // Default value in init
			forceTestMode = false, // Default value in init
			httpTimeout = 60, // Default value in init
			includeRaw = true // Default value in init
		};
	}

	function onLoad(){
		binder.map( "sendgrid@sendgridcfc" )
			.to( "#moduleMapping#.sendgrid" )
      .asSingleton()
      .initWith(
        apiKey = settings.apiKey,
        baseUrl = settings.baseUrl,
        forceTestMode = settings.forceTestMode,
        httpTimeout = settings.httpTimeout,
        includeRaw = settings.includeRaw
      );
	}

}

new_contents:
component {

	this.title = "SendGrid Web API v3";
	this.author = "Matthew J. Clemente";
	this.webURL = "https://github.com/mjclemente/sendgrid.cfc";
	this.description = "A wrapper for the SendGrid Web API v3";

	function configure(){
		settings = {
			apiKey = '', // Required
			baseUrl = 'https://api.sendgrid.com/v3', // Default value in init
			forceTestMode = false, // Default value in init
			httpTimeout = 60, // Default value in init
			includeRaw = true // Default value in init
		};
	}

	function onLoad(){
		binder.map( "sendgrid@sendgridcfc" )
			.to( "#moduleMapping#.sendgrid" )
      .asSingleton()
      .initWith(
        apiKey = settings.apiKey,
        baseUrl = settings.baseUrl,
        forceTestMode = settings.forceTestMode,
        httpTimeout = settings.httpTimeout,
        includeRaw = settings.includeRaw
      );
    binder.mapDirectory(
      packagePath = "#moduleMapping#/helpers",
      namespace = "@sendgridcfc"
    );
	}

}

subject: Use directory mapping to add helpers to Wirebox


old_contents:
component  implements="system.interfaces.com.irCMS.cms.cmsCore" {
    public cmsCore function init(required string tablePrefix, required string datasource) {
        variables.datasource  = arguments.datasource;
        variables.tablePrefix = arguments.tablePrefix;

        return this;
    }

    public string function renderTemplate(required string themeName) {

    }

    public query function getThemes() {
        try {
            return new Query().setDatasource(variables.datasource)
                              .setSQL("SELECT themeId, themeName FROM #variables.tablePrefix#_theme WHERE active=:active")
                              .addParam(name="active", value=true, cfsqltype="cf_sql_bit")
                              .execute()
                              .getResult();
        }
        catch(any e) {
            return queryNew('themeName', 'varchar').addRow(1)
                                                   .setCell('themeName', 'irBootstrap');
        }
    }
}

new_contents:
component  implements="system.interfaces.com.irCMS.cms.cmsCore" {
    public cmsCore function init(required string tablePrefix, required string datasource) {
        variables.datasource  = arguments.datasource;
        variables.tablePrefix = arguments.tablePrefix;

        return this;
    }

    public string function renderTemplate(required string themeName) {

    }

    public query function getThemes() {
        try {
            return new Query().setDatasource(variables.datasource)
                              .setSQL("SELECT themeId, themeName FROM #variables.tablePrefix#_theme WHERE active=:active")
                              .addParam(name="active", value=true, cfsqltype="cf_sql_bit")
                              .execute()
                              .getResult();
        }
        catch(any e) {
            variables.errorHandler.processError(themeName='irBootstrap', message=e.message, detail=e.detail);
            abort;
        }
    }
}

subject: Throw an error when no theme is installed.

repos: IcedReaper/irCMS


old_contents:
component {
	function onRequestStart(){
		location(url="../index.cfm/admin:main", addtoken="false");
	}
}

new_contents:
component {

	// ------------------------ APPLICATION SETTINGS ------------------------ //

	this.applicationroot = getDirectoryFromPath(getCurrentTemplatePath());
	this.name = ListLast(this.applicationroot, "\/") & "_" & Hash(this.applicationroot);

	// ------------------------ CALLED WHEN PAGE REQUEST STARTS ------------------------ //

	function onRequestStart(){
		location(url="../index.cfm/admin:main", addtoken="false");
	}
}

subject: Add `this.name` to the admin application.


old_contents:
component {

	function get(required string class) {
		return createObject("java", arguments.class, [expandpath("/cashbox/lib/vindicia_NOAXIS.jar")]);
	}

	function getClassVersion() {
		if (isnull(variables.classVersion)) {
			var ClientConstants = get("com.vindicia.client.ClientConstants");
			variables.classVersion = "v#replace(ClientConstants.getVersion(),'.','_','all')#";
		}

		return variables.classVersion;
	}

}

new_contents:
component {

	function get(required string class) {
		return createObject("java", arguments.class, [expandpath("/cashbox/lib/vindicia.jar")]);
	}

	function getClassVersion() {
		if (isnull(variables.classVersion)) {
			var ClientConstants = get("com.vindicia.client.ClientConstants");
			variables.classVersion = "v#replace(ClientConstants.getVersion(),'.','_','all')#";
		}

		return variables.classVersion;
	}

}

subject: Use standard Java client instead of NOAXIS


old_contents:
component {

    this.name = "ColdBoxTestingSuite" & hash(getCurrentTemplatePath());
    this.sessionManagement  = true;
    this.setClientCookies   = true;
    this.sessionTimeout     = createTimeSpan( 0, 0, 15, 0 );
    this.applicationTimeout = createTimeSpan( 0, 0, 15, 0 );

    testsPath = getDirectoryFromPath( getCurrentTemplatePath() );
    this.mappings[ "/tests" ] = testsPath;
    rootPath = REReplaceNoCase( this.mappings[ "/tests" ], "tests(\\|/)", "" );
    this.mappings[ "/root" ] = rootPath;
    this.mappings[ "/testingModuleRoot" ] = expandPath( rootPath & "../" );
    this.mappings[ "/app" ] = testsPath & "resources/app";
    this.mappings[ "/coldbox" ] = testsPath & "resources/app/coldbox";
    this.mappings[ "/testbox" ] = rootPath & "/testbox";
}

new_contents:
component {

    this.name = "ColdBoxTestingSuite" & hash(getCurrentTemplatePath());
    this.sessionManagement  = true;
    this.setClientCookies   = true;
    this.sessionTimeout     = createTimeSpan( 0, 0, 15, 0 );
    this.applicationTimeout = createTimeSpan( 0, 0, 15, 0 );

    testsPath = getDirectoryFromPath( getCurrentTemplatePath() );
    this.mappings[ "/tests" ] = testsPath;
    rootPath = REReplaceNoCase( this.mappings[ "/tests" ], "tests(\\|/)", "" );
    this.mappings[ "/root" ] = rootPath;
    this.mappings[ "/testingModuleRoot" ] = listDeleteAt( rootPath, listLen( rootPath, '\/' ), "\/" );
    this.mappings[ "/app" ] = testsPath & "resources/app";
    this.mappings[ "/coldbox" ] = testsPath & "resources/app/coldbox";
    this.mappings[ "/testbox" ] = rootPath & "/testbox";
}

subject: Fix mapping on Adobe CF

message: Fix mapping on Adobe CF

repos: elpete/cb-module-template


old_contents:
component extends="coldbox.system.Coldbox" output="false"{
	setting enablecfoutputonly="yes";
	this.name = hash(getCurrentTemplatePath());
	this.sessionManagement = true;
	this.sessionTimeout = createTimeSpan(0,0,30,0);
	this.setClientCookies = true;

	COLDBOX_APP_ROOT_PATH = getDirectoryFromPath(getCurrentTemplatePath());
	COLDBOX_APP_MAPPING   = "";
	COLDBOX_CONFIG_FILE   = "";
	COLDBOX_APP_KEY       = "";

	this.ormEnabled = true;
	this.datasource = "botfly";
	this.ormSettings 	= {
		flushAtRequestEnd		= false,
		automanageSession		= false,
		autogenmap				= true,
		eventHandling			= true,
		logSQL					= true,
		secondaryCacheEnabled	= true,
		useDBForMapping			= false,
		savemapping				= false,
		skipCFCWithError		= true,
		cacheprovider			= "ehCache",
		dbcreate				= "none",
		eventHandler			= "botfly.model.EventHandler",
		cfclocation				= "model"
	};

	public boolean function onRequestStart(required string targetPage){

		if(findNoCase('index.cfm', listLast(arguments.targetPage, '/'))){
			reloadChecks();
			processColdBoxRequest();
		}

		return true;
	}

}

new_contents:
component extends="coldbox.system.Coldbox" output="false"{
	setting enablecfoutputonly="yes";
	this.name = hash(getCurrentTemplatePath());
	this.sessionManagement = true;
	this.sessionTimeout = createTimeSpan(0,0,30,0);
	this.setClientCookies = true;

	COLDBOX_APP_ROOT_PATH = getDirectoryFromPath(getCurrentTemplatePath());
	COLDBOX_APP_MAPPING   = "";
	COLDBOX_CONFIG_FILE   = "";
	COLDBOX_APP_KEY       = "";

	this.ormEnabled = true;
	this.datasource = "{botfly}";
	this.ormSettings 	= {
		flushAtRequestEnd		= false,
		automanageSession		= false,
		autogenmap				= true,
		eventHandling			= true,
		logSQL					= true,
		secondaryCacheEnabled	= true,
		useDBForMapping			= false,
		savemapping				= false,
		skipCFCWithError		= true,
		cacheprovider			= "ehCache",
		dbcreate				= "none",
		eventHandler			= "botfly.model.EventHandler",
		cfclocation				= "model"
	};

	public boolean function onRequestStart(required string targetPage){

		if(findNoCase('index.cfm', listLast(arguments.targetPage, '/'))){
			reloadChecks();
			processColdBoxRequest();
		}

		return true;
	}

}

subject: Replace {botfly} with correct datasource


old_contents:
component {

	this.title = "SendGrid Web API v3";
	this.author = "Matthew J. Clemente";
	this.webURL = "https://github.com/mjclemente/sendgrid.cfc";
	this.description = "A wrapper for the SendGrid Web API v3";

	function configure(){
		settings = {
			apiKey = '', // Required
			baseUrl = 'https://api.sendgrid.com/v3', // Default value in init
			forceTestMode = false, // Default value in init
			httpTimeout = 60, // Default value in init
			includeRaw = true // Default value in init
		};
	}

	function onLoad(){
		binder.map( "sendgrid@sendgridcfc" )
			.to( "#moduleMapping#.sendgrid" )
      .asSingleton()
      .initWith(
        apiKey = settings.apiKey,
        baseUrl = settings.baseUrl,
        forceTestMode = settings.forceTestMode,
        httpTimeout = settings.httpTimeout,
        includeRaw = settings.includeRaw
      );
    binder.mapDirectory(
      packagePath = "#moduleMapping#/helpers",
      namespace = "@sendgridcfc"
    );
	}

}

new_contents:
component {

	this.title = "SendGrid Web API v3";
	this.author = "Matthew J. Clemente";
	this.webURL = "https://github.com/mjclemente/sendgrid.cfc";
	this.description = "A wrapper for the SendGrid Web API v3";

	function configure(){
		settings = {
			apiKey = '', // Required
			baseUrl = 'https://api.sendgrid.com/v3', // Default value in init
			forceTestMode = false, // Default value in init
			httpTimeout = 60, // Default value in init
			includeRaw = true // Default value in init
		};
	}

	function onLoad(){
		binder.map( "sendgrid@sendgridcfc" )
			.to( "#moduleMapping#.sendgrid" )
      .asSingleton()
      .initWith(
        apiKey = settings.apiKey,
        baseUrl = settings.baseUrl,
        forceTestMode = settings.forceTestMode,
        httpTimeout = settings.httpTimeout,
        includeRaw = settings.includeRaw
      );
    binder.mapDirectory(
      packagePath = "#REreplace( moduleMapping, '^/', '' )#/helpers",
      namespace = "@sendgridcfc"
    );
	}

}

subject: Remove leading slash for modulemapping

message: Remove leading slash for modulemapping


old_contents:
component extends="org.lucee.cfml.test.LuceeTestCase"{
	function run( testResults , testBox ) {
		describe( title="Test suite for LDEV-1467", body=function() {
			it(title="Checking REMatch() is not support with line breaks ", body = function( currentSpec ) {
				REMatchTest = ArrayLen( REMatch( '.', Chr( 10 ) ) );
				expect(REMatchTest).toBe(1);
			});
			it(title="Checking REFind() is support with line breaks", body = function( currentSpec ) {
				REFindTest = REFind( '.',Chr( 10 ) ) ;
				expect(REFindTest).toBe(1);
			});
		});
	}
}

new_contents:
component extends="org.lucee.cfml.test.LuceeTestCase"{
	function run( testResults , testBox ) {
		describe( title="Test suite for LDEV-1467", body=function() {
			it(title="Checking REMatch() with line breaks ", body = function( currentSpec ) {
				REMatchTest = ArrayLen( REMatch( '.', Chr( 10 ) ) );
				expect(REMatchTest).toBe(1);
			});
			it(title="Checking REFind() with line breaks", body = function( currentSpec ) {
				REFindTest = REFind( '.',Chr( 10 ) ) ;
				expect(REFindTest).toBe(1);
			});
		});
	}
}

subject: Rename the test suite iterations

message: Rename the test suite iterations


old_contents:
component displayName="Leap Tests" extends="testbox.system.BaseSpec" {

   // executes before all tests
   function beforeTests(){
      leapObj = createObject("leap");
   }

   function testLeapYear() {
      $assert.isTrue(leapObj.isLeapYear(1996));
   }

   function testNonLeapYear() {
      $assert.isFalse(leapObj.isLeapYear(1997));
   }

   function testNonLeapEvenYear() {
      $assert.isFalse(leapObj.isLeapYear(1998));
   }

   function testCentury() {
      $assert.isFalse(leapObj.isLeapYear(1900));
   }

   function testfourthCentury() {
      $assert.isTrue(leapObj.isLeapYear(2400));
   }

   function testY2K() {
      $assert.isTrue(leapObj.isLeapYear(2000));
   }

   // executes after all tests
   function afterTests(){}

}

new_contents:
component extends="testbox.system.BaseSpec" {

	function beforeAll(){
	  leapObj = createObject( 'leap' );
	}

	function run(){

		describe( "My Leap year calculator", function(){

			it( "should detect a leap year", function(){
      			expect( leapObj.isLeapYear( 1996 ) ).toBeTrue();
			});

			it( "should detect a non-leap year", function(){
      			expect( leapObj.isLeapYear( 1997 ) ).toBeFalse();
			});

			it( "should detect a non-leap even year", function(){
      			expect( leapObj.isLeapYear( 1998 ) ).toBeFalse();
			});

			it( "should detect a century", function(){
      			expect( leapObj.isLeapYear( 1900 ) ).toBeFalse();
			});

			it( "should detect a fourth century", function(){
      			expect( leapObj.isLeapYear( 2400 ) ).toBeTrue();
			});

			it( "should detect Y2K", function(){
      			expect( leapObj.isLeapYear( 2000 ) ).toBeTrue();
			});

		});

	}

}

subject: Convert to BDD style tests

message: Convert to BDD style tests

repos: exercism/xcoldfusion


old_contents:
component {

	this.title = "SendGrid Web API v3";
	this.author = "Matthew J. Clemente";
	this.webURL = "https://github.com/mjclemente/sendgrid.cfc";
	this.description = "A wrapper for the SendGrid Web API v3";

	function configure(){
		settings = {
			apiKey = '', // Required
			baseUrl = 'https://api.sendgrid.com/v3', // Default value in init
			forceTestMode = false, // Default value in init
			httpTimeout = 60, // Default value in init
			includeRaw = true // Default value in init
		};
	}

	function onLoad(){
		parseParentSettings();
		var sendGridAPISettings = controller.getConfigSettings().sendGrid;

		binder.map( "sendGrid@sendGrid" )
			.to( "#moduleMapping#.sendgrid" )
			.initArg( name="apiKey", value=sendGridAPISettings.apiKey )
			.initArg( name="baseUrl", value=sendGridAPISettings.baseUrl )
			.initArg( name="forceTestMode", value=sendGridAPISettings.forceTestMode )
			.initArg( name="httpTimeout", value=sendGridAPISettings.httpTimeout )
			.initArg( name="includeRaw", value=sendGridAPISettings.includeRaw );
	}

	private function parseParentSettings(){
		var oConfig      = controller.getSetting( "ColdBoxConfig" );
		var configStruct = controller.getConfigSettings();
		var sendGridDSL  = oConfig.getPropertyMixin( "sendGrid", "variables", structnew() );

		//defaults
		configStruct.sendGrid = variables.settings;

		// incorporate settings
		structAppend( configStruct.sendGrid, sendGridDSL, true );
	}

}

new_contents:
component {

	this.title = "SendGrid Web API v3";
	this.author = "Matthew J. Clemente";
	this.webURL = "https://github.com/mjclemente/sendgrid.cfc";
	this.description = "A wrapper for the SendGrid Web API v3";

	function configure(){
		settings = {
			apiKey = '', // Required
			baseUrl = 'https://api.sendgrid.com/v3', // Default value in init
			forceTestMode = false, // Default value in init
			httpTimeout = 60, // Default value in init
			includeRaw = true // Default value in init
		};
	}

	function onLoad(){
		binder.map( "sendGrid@sendGrid" )
			.to( "#moduleMapping#.sendgrid" )
      .asSingleton()
      .initWith(
        apiKey = settings.apiKey,
        baseUrl = settings.baseUrl,
        forceTestMode = settings.forceTestMode,
        httpTimeout = settings.httpTimeout,
        includeRaw = settings.includeRaw
      );
	}

}

subject: Simplify onLoad(), eliminating need for private method


old_contents:
<cfcomponent>
  <cfset this.name = "idealcfcexample" />

  <cffunction name="onApplicationStart">
    <cfset application.ideal = createObject( "lib/cfc/ideal" ).init( config = expandPath( "./config/production.cfm" )) />
  </cffunction>

  <cffunction name="onRequestStart">
    <cfif not structKeyExists( application, "ideal" ) or
          (
            structKeyExists( url, "reload" ) and
            isBoolean( url.reload ) and
            url.reload
          )>
      <cfset onApplicationStart() />
      <cfset application.ideal.reload = true />
    </cfif>

    <cfset request.ideal = application.ideal />
  </cffunction>

  <cffunction name="onError">
    <cfargument name="error" />

    <cfdump var="#application#" />
    <cfdump var="#error#" />
  </cffunction>
</cfcomponent>

new_contents:
<cfcomponent>
  <cfset this.name = "idealcfcexample" />

  <cffunction name="onApplicationStart">
    <cfif structKeyExists( application, "ideal" )>
      <cfset structDelete( application, "ideal" ) />
    </cfif>

    <cfset application.ideal = createObject( "lib/cfc/ideal" ).init( config = expandPath( "./config/test.cfm" )) />
  </cffunction>

  <cffunction name="onRequestStart">
    <cfif not structKeyExists( application, "ideal" ) or
          (
            structKeyExists( url, "reload" ) and
            isBoolean( url.reload ) and
            url.reload
          )>
      <cfset onApplicationStart() />
      <cfset application.ideal.reload = true />
    </cfif>

    <cfset request.ideal = application.ideal />
  </cffunction>

  <cffunction name="onError">
    <cfargument name="error" />
    <cfoutput>

#error.message#

#error.detail#

    </cfoutput>
    <cfdump var="#error#" />
  </cffunction>
</cfcomponent>

message:
Use test config file instead of production

Needed to do proper testing

repos: mjhagen/idealcfc


old_contents:
component {

	this.title = "SendGrid Web API v3";
	this.author = "Matthew J. Clemente";
	this.webURL = "https://github.com/mjclemente/sendgrid.cfc";
	this.description = "A wrapper for the SendGrid Web API v3";

	function configure(){
		settings = {
      apiKey = '', // Required
      emailValidationApiKey = '', // Optional
			baseUrl = 'https://api.sendgrid.com/v3', // Default value in init
			forceTestMode = false, // Default value in init
			httpTimeout = 60, // Default value in init
			includeRaw = true // Default value in init
		};
	}

	function onLoad(){
		binder.map( "sendgrid@sendgridcfc" )
			.to( "#moduleMapping#.sendgrid" )
      .asSingleton()
      .initWith(
        apiKey = settings.apiKey,
        emailValidationApiKey = settings.emailValidationApiKey,
        baseUrl = settings.baseUrl,
        forceTestMode = settings.forceTestMode,
        httpTimeout = settings.httpTimeout,
        includeRaw = settings.includeRaw
      );
    binder.mapDirectory(
      packagePath = "#REreplace( moduleMapping, '^/', '' )#/helpers",
      namespace = "@sendgridcfc"
    );
	}

}

new_contents:
component {

	this.title = "SendGrid Web API v3";
	this.author = "Matthew J. Clemente";
	this.webURL = "https://github.com/mjclemente/sendgrid.cfc";
	this.description = "A wrapper for the SendGrid Web API v3";

	function configure(){
		settings = {
      apiKey = '', // Required
      emailValidationApiKey = '', // Optional
			baseUrl = 'https://api.sendgrid.com/v3', // Default value in init
			forceTestMode = false, // Default value in init
			httpTimeout = 60, // Default value in init
			includeRaw = false // Default value in init
		};
	}

	function onLoad(){
		binder.map( "sendgrid@sendgridcfc" )
			.to( "#moduleMapping#.sendgrid" )
      .asSingleton()
      .initWith(
        apiKey = settings.apiKey,
        emailValidationApiKey = settings.emailValidationApiKey,
        baseUrl = settings.baseUrl,
        forceTestMode = settings.forceTestMode,
        httpTimeout = settings.httpTimeout,
        includeRaw = settings.includeRaw
      );
    binder.mapDirectory(
      packagePath = "#REreplace( moduleMapping, '^/', '' )#/helpers",
      namespace = "@sendgridcfc"
    );
	}

}

subject: Update module config default to match component for include raw param


old_contents:
component extends="Model" {

	function config() {
		hasMany(name="galleries");
		hasOne(name="combikey");
		hasOne(name="author", foreignKey="firstName", joinKey="firstName");
		hasMany(name="authors", foreignKey="firstName", joinKey="firstName");
		hasMany(name="combikeys");
		hasMany(name="outerjoinphotogalleries", modelName="gallery", jointype="outer");
		validatesPresenceOf("username, password, firstname, lastname");
		validatesUniquenessOf("username");
		validatesLengthOf(property="username", minimum="4", maximum="20", when="onCreate", message="Please shorten your [property] please. [maximum] characters is the maximum length allowed.");
		validatesLengthOf(property="password", minimum="4", when="onUpdate");
		validate("validateCalled");
		validateOnCreate("validateOnCreateCalled");
		validateOnUpdate("validateOnUpdateCalled");
		property(name="salesTotal", sql="SUM(birthDayMonth)", select=false, dataType="int");
	}

	function validateCalled() {
		this._validateCalled = true;
	}

	function validateOnCreateCalled() {
		this._validateOnCreateCalled = true;
	}

	function validateOnUpdateCalled() {
		this._validateOnUpdateCalled = true;
	}

}

new_contents:
component extends="Model" {

	function config() {
		hasMany(name="galleries");
		hasOne(name="combikey");
		hasOne(name="author", foreignKey="firstName", joinKey="firstName");
		hasMany(name="authors", foreignKey="firstName", joinKey="firstName");
		hasMany(name="combikeys");
		hasMany(name="outerjoinphotogalleries", modelName="gallery", jointype="outer");
		validatesPresenceOf("username, password, firstname, lastname");
		validatesUniquenessOf("username");
		validatesLengthOf(property="username", minimum="4", maximum="20", when="onCreate", message="Please shorten your [property] please. [maximum] characters is the maximum length allowed.");
		validatesLengthOf(property="password", minimum="4", when="onUpdate");
		validate("validateCalled");
		validateOnCreate("validateOnCreateCalled");
		validateOnUpdate("validateOnUpdateCalled");
		local.db_info = $dbinfo(datasource=application.wheels.dataSourceName, type="version");
		local.db = LCase(Replace(local.db_info.database_productname, " ", "", "all"));
		if (local.db IS "oracle") {
			property(name="salesTotal", sql="SUM(birthDayMonth)", select=false, dataType="number");
		} else {
			property(name="salesTotal", sql="SUM(birthDayMonth)", select=false, dataType="int");
		}
	}

	function validateCalled() {
		this._validateCalled = true;
	}

	function validateOnCreateCalled() {
		this._validateOnCreateCalled = true;
	}

	function validateOnUpdateCalled() {
		this._validateOnUpdateCalled = true;
	}

}

subject: Use number instead of int for Oracle.

message: Use number instead of int for Oracle.


old_contents:
component {
	pgSQL = getCredentials();
    this.name = "test3426";
    this.datasources["LDEV_3426"] = pgSQL;
	this.datasource = "LDEV_3426"
    public function onRequestStart(){
		query{
			echo("DROP TABLE IF EXISTS LDEV3426_Primary");
		}
        query{
			echo("DROP TABLE IF EXISTS LDEV3426_test");
		}
		query{
			echo("CREATE TABLE LDEV3426_Primary( id SERIAL NOT NULL PRIMARY KEY, test VARCHAR(50))");
		}
	}
    private struct function getCredentials() {
    	return server.getDatasource("postgres");
	}
    public function onRequestEnd(){
		query{
			echo("DROP TABLE IF EXISTS LDEV3426_Primary");
		}
	}
}

new_contents:
component {
    pgSQL = getCredentials();
    this.name = "test3426";
    this.datasources["LDEV_3426"] = pgSQL;
    this.datasource = "LDEV_3426"
    public function onRequestStart(){
        if( StructIsEmpty(pgSQL) ){
            writeoutput("Datasource credentials was not available"); // Datasource credentials was not available means need to stop the iterations.
            abort;
        }
        query{
        echo("DROP TABLE IF EXISTS LDEV3426_test");
        }
        query{
            echo("DROP TABLE IF EXISTS LDEV3426_Primary");
        }
        query{
            echo("CREATE TABLE LDEV3426_Primary( id SERIAL NOT NULL PRIMARY KEY, test VARCHAR(50))");
        }
    }
    private struct function getCredentials() {
        return server.getDatasource("postgres");
    }
    public function onRequestEnd(){
        if( StructIsEmpty(pgSQL) ) return;
        query{
            echo("DROP TABLE IF EXISTS LDEV3426_test");
        }
        query{
            echo("DROP TABLE IF EXISTS LDEV3426_Primary");
        }
    }
}

subject: Update the testcase to check datasource credentials available or not


new_contents:
component extends="org.lucee.cfml.test.LuceeTestCase"{
	function run( testResults , testBox ) {
		describe( "Test suite for LDEV-1167", function() {
			it(title="checking WDDX tag, with action = 'wddx2cfml' when the struct empty ", body = function( currentSpec ) {
				var myWDDX = "<wddxPacket version='1.0'><header/><data><struct type='coldfusion.server.ConfigMap'/></data></wddxPacket>";
				cfwddx( action='wddx2cfml', input=myWDDX, output='local.myData');
				expect(local.myData).toBeTypeOf('struct')
			});

			it(title="checking WDDX tag, with action = 'wddx2cfml' when the query empty ", body = function( currentSpec ) {
				myWDDX = "<wddxPacket version='1.0'><header/><data><recordset rowCount='0' fieldNames='id,name' type='coldfusion.sql.QueryTable'><field name='id'></field><field name='name'></field></recordset></data></wddxPacket>";
				cfwddx( action='wddx2cfml', input=myWDDX, output='local.myData');
				expect(local.myData).toBeTypeOf('query')
			});
		});
	}
}

subject: Add test case for LDEV-1167

message: Add test case for LDEV-1167


new_contents:
component
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public void function up()
    {
        var table = schema('tblEPOS_Items');
        table.foreign('eiNomID').references('tblEPOS_Account', 'eaID').onDelete('restrict');
        table.update();
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public void function down()
    {
        schema('tblEPOS_Items').dropForeign('eiNomID');
    }
}

subject: Add foreign key to EPOS items nom ID

message: Add foreign key to EPOS items nom ID