PHP Codeception

Great functional/BDD testing framework. BEAUTIFUL syntax.

wget http://codeception.com/codecept.phar
php codecept.phar bootstrap
php codecept.phar generate:suite services
php codecept.phar generate:cept services LoginService

Edit services.suite.yml


class_name: ServicesTester
modules:
    enabled:
        - PhpBrowser
        - AcceptanceHelper
        - REST
    config:
        PhpBrowser:
            url: 'http://localhost/'

Alter APACHE PATH environment variables for PHP

In phpinfo(); under Apache Environment section, you will see PATH

On the mac this was stuck at /usr/bin:/bin:/usr/sbin:/sbin

One way to remedy this is to edit the launchDaemon plist file...
vi /System/Library/LaunchDaemons/org.apache.httpd.plist


Add the following key
EnvironmentVariables
PATH /usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin

Moc'ing XXXX.h... File not found / no such file

There's a couple potential causes for having issue with Moc'ing (QT) files in Visual Studio 201X.

For the most part, the fact that you get this message means that QT plugin is working, so I won't go into trouble-shooting that.


In my case, it had to do with the QTDIR environment variable being 'cached' in the vcproj.user file.

In otherwords, I set my system env QTDIR=c:\qt, and later changed it to c:\qt5

VS continues to use c:\qt due to the vcproj.user file


Stupid VS >:I

Qt 5.3 for VS2010

The QT installer is built for VS2012 by default, and I need binaries and libs for VS2010. Here's how to get the ball rolling.


Luckily, they already compiled it: http://download.qt-project.org/official_releases/qt/5.3/5.3.2/qt-opensource-windows-x86-msvc2010_opengl-5.3.2.exe

Error installing HAXM on Lenovo W510 running Windows Server 2008

Error message #1:

This computer does not support Execute Disable Bit XD.

Error message #2:

This computer does not support Intel Virtualization Technology (VT-x).

Turns out this can all be solved in the BIOS setting.

For the W510
On the boot screen, hit F1
Config > CPU > Intel Hyper-Threading ENABLED
Config > CPU > Intel Virtualization Technology ENABLED
Config > CPU > Intel VT-d Feature ENABLED
Security > Memory Protection > Execution Prevention ENABLED
Security > Security Chip ACTIVE
Security > Intel TXT Feature DISABLED
Hit F10 to save and restart


Coincidentally, the above configuration can also be used to install HYPER-V for WINDOWS SERVER 2008 R2. Speaking of, you must uninstall or disable HYPER-V in order to install HAXM. Failure to do so yields the 2nd error message above.

Setting up SQL Server 2012

This tutorial should work for setting up a brand new SQL Server instance. In this case, I am using SQL Server 2012.
  • If you can't find SQL Server Management Studio, you may need to install it first.
    1. Download SQLManagementStudio_x64_EMU, run setup
    2. During the Feature Selection step, select Management Tools - Basic (or Complete)
    3. After the installation is complete the executable can be located at:
      • C:\Program Files (x86)\Microsoft SQL Server\120\Tools\Binn\ManagementStudio\ssms.exe
    4. NOTE: Make sure the database supports both Windows authentication and SQL Server Authentication
  • Creating credentials for remote SQL server access
    1. NOTE: If you have the sa user password, you can just use that account to connect remotely
    2. On the SQL Server, sign in as Administrator or sa (If you forgot your sa password, it can be reset)
    3. Once connected to the local DB Engine, go to Object Explorer > SERVERNAME > Security > Logins
    4. Right click on Logins > New Login ...
    5. Under General > enter Login name
    6. Under General > select SQL Server authentication, uncheck Enforce password policy
    7. Under Server Roles > check public, sysadmin
    8. Click OK to save
At this point, you should have properly set up the credentials for remote login. This next section discusses how to set up the server such that it can be accessed remotely. Keep in mind I don't go over my Windows Firewall setup, that'd be on you.
  • On the SQL server, open up Computer Management
  • Expand Services and Applications
  • Expand SQL Server Configuration Manager
  • Select SQL Server Network Configuration
    1. Select Protocols for SERVERNAME
    2. Right click TCP/IP > Enable
    3. Right click > Properties > IP Addresses tab
    4. Note the IP Address (ie. 192.168.1.35)
    5. Enter 1433 for TCP Port (Your firewall needs to open 1433)
    6. Click OK to save
  • Select SQL Server Services, you should see...
    1. SQL Server (SERVERNAME) Running
    2. SQL Server Agent (SERVERNAME) Stopped
    3. SQL Server Browser Running
  • Restart #1 and #3 services listed directly above
At this point you should be good to go. Just 1 last step inputting the correct hostname, username, etc.
  • Server type: Database Engine
  • Server name: 192.168.1.35\SERVERNAME
  • Authentication: SQL Server Authentication
  • Login: Username set up above, or sa
  • Password: Self-explanatory
Done.