Changeset View
Changeset View
Standalone View
Standalone View
duchain/tests/duchain.cpp
Show First 20 Lines • Show All 2992 Lines • ▼ Show 20 Line(s) | 2985 | { | |||
---|---|---|---|---|---|
2993 | 2993 | | |||
2994 | TopDUContext* top = parse(method); | 2994 | TopDUContext* top = parse(method); | ||
2995 | QVERIFY(top); | 2995 | QVERIFY(top); | ||
2996 | DUChainReleaser releaseTop(top); | 2996 | DUChainReleaser releaseTop(top); | ||
2997 | DUChainWriteLocker lock(DUChain::lock()); | 2997 | DUChainWriteLocker lock(DUChain::lock()); | ||
2998 | 2998 | | |||
2999 | QCOMPARE(top->problems().size(),1); | 2999 | QCOMPARE(top->problems().size(),1); | ||
3000 | } | 3000 | } | ||
3001 | | ||||
3002 | void TestDUChain::staticFunctionClassPhp54() | ||||
3003 | { | ||||
3004 | QByteArray method("<?php\n" | ||||
3005 | " class A\n" | ||||
3006 | " {\n" | ||||
3007 | " public static function func() {} \n" | ||||
3008 | " }\n" | ||||
3009 | " A::{'func'}(); \n"); | ||||
3010 | | ||||
3011 | TopDUContext* top = parse(method); | ||||
3012 | QVERIFY(top); | ||||
3013 | DUChainReleaser releaseTop(top); | ||||
3014 | DUChainWriteLocker lock(DUChain::lock()); | ||||
3015 | | ||||
3016 | QVERIFY(top->problems().isEmpty()); | ||||
3017 | QCOMPARE(top->localDeclarations().count(),1); | ||||
3018 | | ||||
3019 | Declaration* dec = top->localDeclarations().at(0); | ||||
3020 | ClassDeclaration* classDec = dynamic_cast<ClassDeclaration*>(dec); | ||||
3021 | QCOMPARE(classDec->uses().count(),1); | ||||
3022 | } |